The 2024 CPC Asia Shanghai Regional Contest Shanghai,2024.11.17 Problem C.Conquer the…
- User
The 2024 CPC Asia Shanghai Regional Contest Shanghai,2024.11.17 Problem C.Conquer the Multiples Input fle: standard input Output file: standard output Alice and Bob are two brilliant strategists who stumble upon a mystical blackboard in an ancient temple, where a sequence of integers 1,/+ 1,...,r is written. Next to the blackboard is a special number r, initially set to 1. The rules of the game are simple but challenging: Alice and Bob take turns erasing exactly one multiple of r from the blackboard, with Alice always making the first move. After each move, the value of x is increased by 1. and the game continues. If a player cannot erase a multiple of the current x, they lose the game. Both players, eager to prove their tactical brilliance, will play optimally to secure victory. Can you determine which player will ultimately win this battle of multiples? Input This problem contains multiple test cases. The first line of input contains an integer T (1 ≤T ≤10), denoting the number of test cases. For each test case, there is only one line of input. This line contains two integers l,r (1 ≤l≤r≤109), denoting the range of numbers (l,l +1,...,r) initially on the blackboard. Output For each test case, output one line. If Alice will win, print “Alice” in this line. Otherwise, print“Bob". Example standard input standard output Alice 3 2 4 44 Bob Alice 67
Page 5 of 21
- Assistant
To solve the problem "Conquer the Multiples," we need to determine which player, Alice or Bob, will win the game based on the given rules and the range of numbers on the blackboard.
Game Rules:
- Alice and Bob take turns erasing exactly one multiple of a special number
rfrom the blackboard.
- Alice and Bob take turns erasing exactly one multiple of a special number