ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Data Structures > задача:


51075 - Shortest Path for Bishop

Гость
• Вопросы к жюри (1)

Задачи сборника

• 50828 - Arranging Time Table
• 50447 - Swimming Contest - 2
• 51072 - Castle on chessboard
• 51082 - Sum is equal to K - 1
• 50794 - Writing Files Into HDD
• 51020 - Number of nodes removed
• 51023 - Preparing Keyword Index
• 50929 - Present from your uncles
• 51075 - Shortest Path for Bishop
• 50863 - Total Access Cost of a BST
• 50979 - Minimum access cost for BST
• 50688 - Epoka Furgon
• 50750 - Service Time - 2
• 50706 - The most crowded Club
• 50689 - The biggest building block
• 50686 - The Container
• 50771 - BST Level Sum

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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