AtCoder Regular Contest 208 (Div. 2)
A
Bitwise OR Game
AtCoder
⌀ 1394
原题
←B →
翻译中…

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.

翻译中…

样例

Input #1
4
3
3 4 6
3
7 7 7
3
9 3 5
10
1 9 1 3 7 9 10 9 7 3
Output #1
Alice
Bob
Bob
Alice
Consider the first test case. Initially, the bitwise $\mathrm{OR}$ of the numbers of stones of all piles is $3\ \mathrm{OR}\ 4\ \mathrm{OR}\ 6=7$. The moves Alice can make are as follows: - Remove two stones from the first pile. - Remove one or more stones from the second pile. - Remove one or more stones from the third pile. For example, if Alice removes one stone from the first pile, the bitwise $\mathrm{OR}$ of the numbers of stones of all piles becomes $2\ \mathrm{OR}\ 4\ \mathrm{OR}\ 6=6$. Therefore, Alice cannot make the move of removing one stone from the first pile. If Alice removes six stones from the third pile, Bob cannot make any move in the next turn. Therefore, the winner when both players play optimally is Alice.
题目信息
题号
arc208_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。