Amplification Battle
Practice
3.8 (17 votes)
Dynamic programming
Algorithms
Easy Medium
Mathematics
Open
Approved
Game theory
Problem
22% Success 3595 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code

See Russian Translation

Adam and Bob are playing a game. The game is parameterized by the three integers a,b,c. They start out with the integer 1, with Adam going first. Suppose the current integer is S. On a player's turn, he may change the current integer to any integer between a×S and b×S, inclusive. The first player to make the current integer be at least as large as c is declared the winner. Given that Adam and Bob play optimally, return the winner of the game.

Input format:

The first line of input will contain an integer T, denoting the number of test cases. Each test case will be given on one line, which contains 3 integers, a,b,c

Output format:

Print the name of the person who will win for each test case on a separate line.

Constraints:

For all subtasks
1 ≤ T ≤ 104

30 pts:
2 ≤ ab ≤ 10
2 ≤ c ≤ 20

60 pts:
2 ≤ ab ≤ 50
2 ≤ c ≤ 1,000

10 pts:
2 ≤ ab ≤ 100
2 ≤ c ≤ 1018

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
3 votes
Tags:
MathematicsPrime FactorizationEasy-MediumGame TheoryNumber Theory
Points:30
1 votes
Tags:
GeometryMathematicsapprovedGame TheoryEasy-Medium