[CF2290E] 雪崩博弈 (Avalanche)
Problem Statement
There are piles of stones in a line, numbered through from left to right, initially containing stones. You are also given an integer .
Alice and Bob play a turn-based game with Alice going first. On a player's turn, they choose any non-empty pile , remove stone from pile , and add new stone to each of the up to piles immediately to its left (i.e., all piles with ; if , no stones are added). There is an unlimited supply of new stones.
The player who cannot make a valid move (when all piles are empty) loses. It can be shown that the game always terminates in finitely many moves. Assuming optimal play from both players, determine who wins.
Input
The first line contains () — the number of test cases.
The first line of each test case contains and (, ). The second line contains integers ().
It is guaranteed that the sum of over all test cases does not exceed .
Output
For each test case, print "Alice" if Alice wins, or "Bob" if Bob wins.
Example
5
2 1
1 1
3 2
0 0 1
4 1
0 0 1 0
5 2
1 2 3 4 5
3 1
2 5 2
Alice
Bob
Alice
Alice
Bob
Note
- Constraints: , , , , .
- Source: Codeforces 2290E · Avalanche