AT_arc225_b [ARC225B] Independent Nim
Description
There is an integer sequence $ A $ of length $ N $ . Each element of $ A $ is $ 0 $ or $ 1 $ .
Alice and Bob play a game. Starting with Alice, they alternately perform the following operation.
- Choose one or more elements of $ A $ that are $ 1 $ , and set them to $ 0 $ . Here, it is forbidden to choose adjacent elements simultaneously.
The player who is first unable to perform the operation loses.
Determine which player wins when both players play optimally.
You are given $ T $ test cases; solve each of them.
Input Format
The input is given from Standard Input in the following format:
> $ T $ $ \text{case}_1 $ $ \text{case}_2 $ $ \vdots $ $ \text{case}_T $
Each case is given in the following format:
> $ N $ $ A_1 $ $ A_2 $ $ \cdots $ $ A_N $
Output Format
Output $ T $ lines. The $ i $ -th line should contain `Alice` if Alice wins for $ \text{case}_i $ , and `Bob` if Bob wins.
Explanation/Hint
### Sample Explanation 1
For the first test case, Alice can set all elements to $ 0 $ by choosing the first, third, and fifth elements and setting them to $ 0 $ in her first operation.
Then, Bob cannot perform an operation, so Alice wins when both players play optimally.
For the second test case, Alice can only choose one of the two elements in her first operation.
### Constraints
- $ 1 \le T \le 10^5 $
- $ 1 \le N \le 2\times 10^5 $
- $ A_i = 0 $ or $ A_i = 1 $ .
- The sum of $ N $ over all test cases is at most $ 2\times 10^5 $ .
- All input values are integers.