No.3112 Decrement or Mod Game
Problem Statement
Alice and Bob have positive integers $A,B$, respectively. The two play a game with these numbers.
Starting with Alice, the two alternately perform one of the following operations until the number held by either of them becomes 0.
- Decrease your own number by 1.
- Replace your own number with the remainder when it is divided by the opponent's number. This operation can be performed only when the opponent's number is less than or equal to your own number.
The player whose own number becomes 0 first wins. When both players act optimally, who wins?
It can be proved that this game always comes to an end.
Constraints
- $1 \leq A,B \leq 10^{18}$
Input
The input is given from standard input in the following format.
$A$ $B$
Output
Print the name of the winner (Alice or Bob) on one line.
Sample
Sample 1
Input
5 3
Output
Alice
Here is one example of how the game may proceed.
- Alice performs the operation of replacing her number with the remainder when it is divided by the opponent's number. $A$ becomes $2$.
- Bob performs the operation of decreasing his number by 1. $B$ becomes $2$.
- Alice performs the operation of replacing her number with the remainder when it is divided by the opponent's number. $A$ becomes $0$. The game ends with Alice as the winner.
In this example, the players are not necessarily acting optimally, but it can be proved that Alice wins even when both players act optimally.
Sample 2
Input
2 9
Output
Bob
Sample 3
Input
271828459045235602 314159265358979323
Output
Bob
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。