HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC-2014-15 Questions > problem:


Ind_01-20. 50416 - Placing Dominoes on Chessboard

IMPC-2014-15 Questions

Start: Nov.22.2014 at 03:00:00 PM
Finish: Nov.22.2014 at 08:00:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (3)

Contest problems

• 3rd-4. 50406 - Draw Pattern 178
• 3rd-5. 50415 - The Scientist
• 3rd-6. 50695 - Longest link between...
• 4th-1. 50491 - Brokers
• 4th-2. 50524 - Elevator
• 4th-3. 50535 - Image Compression
• 4th-6. 50536 - Epoka Furgon Shpk
• Ind_01-10. 50752 - Student Groups
• Ind_01-20. 50416 - Placing Dom...
• Ind_01-30. 50764 - Fast Typing Co...
• Ind_01-50. 50718 - Elevator
• Ind_02-10. 50497 - Falling Bricks - ...
• Ind_02-20. 50745 - Bitonic Sequence
• Ind_02-30. 50657 - Permutations an...
• Ind_03-10. 50743 - Total Scholarshi...
• Ind_03-20. 50515 - Lines - Revisited
• Ind_03-40. 50777 - Dwarfs Maze

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