atcoder#AGC020A. [AGC020A] Move and Win
[AGC020A] Move and Win
Score : points
Problem Statement
A game is played on a strip consisting of cells consecutively numbered from 1 to .
Alice has her token on cell . Borys has his token on a different cell .
Players take turns, Alice moves first. The moving player must shift his or her token from its current cell to the neighboring cell on the left, cell , or on the right, cell . Note that it's disallowed to move the token outside the strip or to the cell with the other player's token. In one turn, the token of the moving player must be shifted exactly once.
The player who can't make a move loses, and the other player wins.
Both players want to win. Who wins if they play optimally?
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print Alice
if Alice wins, Borys
if Borys wins, and Draw
if nobody wins.
5 2 4
Alice
Alice can move her token to cell 3. After that, Borys will be unable to move his token to cell 3, so he will have to move his token to cell 5. Then, Alice moves her token to cell 4. Borys can't make a move and loses.
2 1 2
Borys
Alice can't make the very first move and loses.
58 23 42
Borys