HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


130. 50416 - Placing Dominoes on Chessboard

Guest
• Review clarifications (3)

Volume problems

• 048. 50403 - Number of Chairs
• 052. 50503 - Welcome Andi - 2
• 053. 50501 - The Highest Average
• 062. 50402 - Hello World!
• 063. 50547 - Close Pair
• 068. 50581 - The roots of a quadrati...
• 100. 50532 - Close City
• 120. 50511 - Class Average
• 130. 50416 - Placing Dominoes...
• 140. 50417 - Fun Fair
• 150. 50500 - Find Student
• 260. 50460 - Median of 3 Numbers
• 50292 - Average of 4 Marks
• 001. 51153 - A+B.
• 002. 50348 - Area and Perimeter of ...
• 003. 50349 - Area of a Triangle
• 004. 50350 - Fahrenheit to Celsius

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