Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. Question by Ibrahim Mesecan.
Nine Men's Morris game
In Nine Men's Morris game, the players try to place their pieces
on adjacent points so that they can remove one of the opponent
pieces. For example the pieces on b2, d2 and f2 are adjacent
on a line. Similarly, the pieces on d7, d5 and d6 are also
adjacent on a line. But the pieces on b4, c4 and e4 are not
adjacent on a line.
Question: Write a program that reads
the positions of 4 pieces and decides if any three are
adjacent on a line.
Input specification:
You will be given the coordinates of 4 pieces, a letter
and an integer separated by a space.
Output specification:
Show "Yes" if any three are adjacent on a line,
or "No" otherwise.
Sample Input 1
a7 d6 d7 g7
|
Sample Input 2
b4 c4 e4 g4
|
Sample Output 1
Yes
|
Sample Output 2
No
|
Explanation:
In the first sample, the pieces
a7, d7, and g7 are aligned on a line.
In sample 2, no three pieces are aligned
on a line.
Для отправки решений необходимо выполнить вход.
|