HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Ad-Hoc > problem:


50416 - Placing Dominoes on Chessboard

Guest
• Review clarifications (3)

Section problems

• 50312 - Sales Bar Chart
• 50313 - Pattern Displays
• 50375 - Area of Circles
• 50393 - Palindromic Numbers
• 50396 - Cinema Tickets - 1
• 50325 - How much time passed?
• 50366 - Student Averages (2 Grades)
• 50406 - Draw Pattern 178
• 50416 - Placing Dominoes on C...
• 50477 - Character Pyramids
• 50498 - K-Means
• 50505 - kht Puzzle
• 50346 - The Biggest Date
• 50512 - Coding redundancy
• 50528 - Rock-Scissors-Paper
• 50493 - n-digit kth Prime Number
• 50520 - Filling a Matrix Randomly

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