#P10029. 「Cfz Round 3」Battle
「Cfz Round 3」Battle
Problem Description
Alice and Bob are playing a game with the following rules:
- Alice initially has an integer , and Bob initially has an integer .
- Starting from Alice, the two players take turns operating on the integer owned by the other player. Let the integer currently owned by the other player be . Change by subtracting from it, where denotes the modulo operation, and is a given constant.
- The first player who makes the other player's integer become wins. If no one wins after each of them has made moves, the game is considered a draw.
You need to determine who will win, or report that the game will end in a draw.
Input Format
This problem has multiple test cases.
The first line contains an integer , representing the number of test cases.
Then follow the test cases. For each test case, three integers are given.
Output Format
For each test case, output one string per line as the answer:
- If Alice will win, output
Alice. - If Bob will win, output
Bob. - If the game will be a draw, output
Lasting Battle.
3
1 2 10
9 11 11
55 15 14
Alice
Bob
Lasting Battle
Hint
"Sample Explanation #1"
For the st test case, in her first move, Alice changes Bob's integer from to , which is , so Alice will win.
For the nd test case, in her first move, Alice changes Bob's integer from to , which is . In Bob's first move, he changes Alice's integer from to , which is , so Bob will win.
For the rd test case, it can be proven that the game will be a draw.
"Constraints"
For all testdata, , .
Only if you pass all test points of this problem can you get the score for this problem.
Translated by ChatGPT 5