Problem Statement
There are $N$ piles of stones, and the $i$-th pile $(1\le i\le N)$ has $A_i$ stones.
Alice and Bob will play the following game using these piles:
- Starting with Alice, the two players take turns alternately.
- In each turn, the player chooses one non-empty pile and removes one or more stones from that pile. However, the player cannot make a move that changes the bitwise
$\mathrm{OR}$of the numbers of stones of all piles.
The player who cannot make a move first loses.
Determine which player wins when both players play optimally.
You are given $T$ test cases; solve each of them.
What is bitwise $\mathrm{OR}$? The bitwise $\mathrm{OR}$ of non-negative integers $A$ and $B$, $A\ \mathrm{OR}\ B$, is defined as follows: When $A\ \mathrm{OR}\ B$ is written in binary, the digit in the $2^k$ place ($k \geq 0$) is $1$ if at least one of the digits in the $2^k$ place of $A$ and $B$ written in binary is $1$, and $0$ otherwise. For example, $3\ \mathrm{OR}\ 5 = 7$ (in binary: $011\ \mathrm{OR}\ 101 = 111$). In general, the bitwise $\mathrm{OR}$ of $k$ non-negative integers $p_1, p_2, p_3, \dots, p_k$ is defined as $(\dots ((p_1\ \mathrm{OR}\ p_2)\ \mathrm{OR}\ p_3)\ \mathrm{OR}\ \dots\ \mathrm{OR}\ p_k)$, and it can be proved that this is independent of the order of $p_1, p_2, p_3, \dots p_k$.
Constraints
$1\le T\le 10^5$$2\le N \le 2\times 10^5$- The sum of
$N$over all test cases is at most$2\times 10^5$. $1\le A_i \le 10^9$- All input values are integers.
Input
The input is given from Standard Input in the following format:
T
\text{case}_1
\text{case}_2
\vdots
\text{case}_T
Each test case is given in the following format:
N
A_1 A_2 \ldots A_N
Output
Output the answers for each test case in order, separated by newlines.
For each test case, print Alice if Alice wins when both players play optimally, and Bob if Bob wins.
样例
4
3
3 4 6
3
7 7 7
3
9 3 5
10
1 9 1 3 7 9 10 9 7 3
Alice
Bob
Bob
Alice
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。