Codeforces Round 941 (Div. 1)
A
Everything Nim
Codeforces
1400
原题
←B →
翻译中…

Alice and Bob are playing a game on $n$ piles of stones. On each player's turn, they select a positive integer $k$ that is at most the size of the smallest nonempty pile and remove $k$ stones from each nonempty pile at once. The first player who is unable to make a move (because all piles are empty) loses.

翻译中…

Given that Alice goes first, who will win the game if both players play optimally?

翻译中…

Input

翻译中…

The first line of the input contains a single integer $t$ ($1 \le t \le 10^4$) — the number of test cases. The description of the test cases follows.

翻译中…

The first line of each test case contains a single integer $n$ ($1 \le n \le 2\cdot 10^5$) — the number of piles in the game.

翻译中…

The next line of each test case contains $n$ integers $a_1, a_2, \ldots a_n$ ($1 \le a_i \le 10^9$), where $a_i$ is the initial number of stones in the $i$-th pile.

翻译中…

It is guaranteed that the sum of $n$ over all test cases does not exceed $2\cdot 10^5$.

翻译中…

Output

翻译中…

For each test case, print a single line with the name of the winner, assuming both players play optimally. If Alice wins, print "Alice", otherwise print "Bob" (without quotes).

翻译中…

Note

翻译中…

In the first test case, Alice can win by choosing $k=3$ on her first turn, which will empty all of the piles at once.

翻译中…

In the second test case, Alice must choose $k=1$ on her first turn since there is a pile of size $1$, so Bob can win on the next turn by choosing $k=6$.

翻译中…

样例

Input #1
7
5
3 3 3 3 3
2
1 7
7
1 3 9 7 4 2 100
3
1 2 3
6
2 1 3 4 2 4
8
5 7 2 9 6 3 3 2
1
1000000000
Output #1
Alice
Bob
Alice
Alice
Bob
Alice
Alice
InputCopy OutputCopy
题目信息
题号
1965A
时间限制
2 s
内存限制
256 MB
标签
博弈论
贪心
数学
排序

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