ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Ad-Hoc > задача:


50416 - Placing Dominoes on Chessboard

Гость
• Вопросы к жюри (3)

Задачи раздела

• 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

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 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



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

www.contester.ru