Лимит времени 1000/2000/2000/2000 мс. Лимит памяти 3000/30000/30000/30000 Кб. 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
|
Для отправки решений необходимо выполнить вход.
|