#P17895. [ICPC 2026 Nanchang I] BABA BOOEY
[ICPC 2026 Nanchang I] BABA BOOEY
Problem Description
Alice and Bob take turns playing a game, with Alice going first. Before the first move, there is an array of non-negative integers of length , along with a positive integer . In each move, the current player chooses two integers such that , , and . Then, is updated to , and is updated to . A player who chooses loses immediately. Who has the winning strategy?
Input Format
There are multiple test cases. The first line contains an integer () --- the number of test cases.
For each test case:
The first line contains two integers and (, ).
The second line contains integers ().
It is guaranteed that the sum of over all test cases in a single input file does not exceed .
Output Format
For each test case, output a single string on a new line.
If the first player (Alice) has a winning strategy for the game described, output “Alice”; otherwise, output “Bob”.
3
2 2
1 2
4 5
15 15 8 9
11 2
4 2 9 12 0 15 9 14 5 6 12
Alice
Alice
Bob
Hint
In the first test case, the only winning first moves for Alice are and .