HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > CEN303_2016Questions > problem:


FE3. 51075 - Shortest Path for Bishop

CEN303_2016Questions

Start: Oct.28.2016 at 05:00:00 PM
Finish: Nov.01.2016 at 05:00:00 AM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• FE1. 51076 - Key person
• FE2. 50988 - Laplacian Filter
• FE3. 51075 - Shortest Path for B...
• HW011. 51008 - Sum of Regional M...
• HW012. 51009 - Sum of the nth row
• HW021. 51011 - Decoding the Path
• HW022. 51012 - Palindrome-k
• HW023. 50741 - DNA Distance
• HW031. 51015 - Student Scholarships
• HW032. 51014 - Nine Men's Morris g...
• HW033. 50925 - Optimizing Elevator...

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Shortest Path for Bishop

Question: You have some pieces (blocked cells) on the chessboard and a bishop. Show at least in have many moves the bishop can reach to the given destination.

Input specification: You will be first given 4 integers (x,y) coordinates of starting and destination cells. Then, you will be given an integer (n) the number of blocked cells. Each of the following n lines will provide two integers (x,y) coordinates of the blocked cells.

Output specification: Show one integer.

Sample Input
2 6 7 5
4
3 3
3 5
3 7
5 3
Sample Output
8



Для отправки решений необходимо выполнить вход.

www.contester.ru