Codeforces Round 941 (Div. 1) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

games

greedy

math

sortings

*1400

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. Everything Nim

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputAlice 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).

Example

Input

753 3 3 3 321 771 3 9 7 4 2 10031 2 362 1 3 4 2 485 7 2 9 6 3 3 211000000000

Output

Alice Bob Alice Alice Bob Alice Alice

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$$$.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/14/2024 05:15:16 (k1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|