HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


130. 50416 - Placing Dominoes on Chessboard

Guest
• Review clarifications (3)

Volume problems

• 063. 50547 - Close Pair
• 065. 50436 - Pocket Money
• 068. 50581 - The roots of a quadrati...
• 070. 50439 - Telephone Calls
• 080. 50478 - Letter Grades
• 090. 50422 - Area and Perimeter of...
• 100. 50532 - Close City
• 120. 50511 - Class Average
• 130. 50416 - Placing Dominoes...
• 140. 50417 - Fun Fair
• 150. 50500 - Find Student
• 222. 50302 - Paper Scissors Rock
• 260. 50460 - Median of 3 Numbers

Feedback

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

Time limit 1000/2000/2000/2000 ms. Memory limit 3000/30000/30000/30000 Kb.
Question by Enes Kristo.

Placing Dominoes on Chessboard

We have a nxn chessboard, where n is even and we want to cover it with dominoes with a 1x2 or a 2x1 shape. It is very easy to just place n dominoes on every row, and the exercise is solved. What if we removed two random squares?

Question: Write a program that is going to figure out if the dominoes can be place properly when two given random squares are removed.

Input specification
You will be given an integer (n) where 2 ≤ n ≤ 100 and n is always even. Then, you will be given the coordinates of the two pieces we are removing, where the bottom left square is considered as (1,1) and the top right as (n,n).

Output specification
"Yes" if it is possible, "No" otherwise.

Sample Input I
4
1 1
2 3
Sample Input II
4
1 1
2 2
Sample Output I
Yes
Sample Output II
No



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

www.contester.ru