Repovive
  • Dashboard
  • Ranking
  • Submissions
  • Discussion
  1. Contests
  2. Premier Round 9
  3. 27D

My submissions

/
/
/
/

Announcements

My submissions

/
/
/
/

Announcements

Solve
Author

27D. A Bite Too Late

2000 pts·2s·256 MB

Constraints

Input

Output

Samples

Input
t
2
Case 1
1
1
Case 2
3
1 1 100
Explanation
Case 1

Alice eats the only piece. Bob has no piece to eat and loses.

Case 2
Output
Case 1
Alice
Case 2
Bob
Input
t
3
Case 1
4
1 10 10 10
Case 2
5
3 1 100 2 3
Case 3
5
2 1 3 2 100
Explanation
Case 1
Case 2
Case 3
Output
Case 1
Bob
Case 2
Alice
Case 3
Bob

There are nnn pieces of sushi on a table. Piece iii can be eaten until the end of round aia_iai​. If it has not been eaten by then, it is discarded.

Alice and Bob play a game. Rounds are numbered starting from 111. In each round, Alice takes a turn first, followed by Bob. On their turn, a player must choose and eat exactly one remaining piece of sushi that has not expired.

Expired sushi is discarded only at the end of a round, after Bob's turn. In particular, a piece with deadline rrr can be eaten by either player in round rrr.

A player who cannot eat a piece of sushi on their turn loses immediately.

Determine the winner if both players play optimally.

  • 1≤t≤1041 \le t \le 10^41≤t≤104
  • 1≤n≤2×1051 \le n \le 2 \times 10^51≤n≤2×105
  • 1≤ai≤1091 \le a_i \le 10^91≤ai​≤109
  • The sum of nnn over all test cases does not exceed 2×1052 \times 10^52×105.
ttt na1a2⋯an}×t\left. \begin{array}{l} n \\ a_1 \quad a_2 \quad \cdots \quad a_n \end{array} \right\} \times tna1​a2​⋯an​​}×t

For each test case, print Alice if Alice wins, or Bob if Bob wins.

winner}×t\left. \begin{array}{l} \mathrm{winner} \end{array} \right\} \times twinner​}×t

For example, Alice eats a piece with deadline 111, then Bob eats the piece with deadline 100100100. The remaining piece is discarded at the end of the round, and Alice has no move in round 222.

For example, Alice eats the piece with deadline 111, then Bob eats a piece with deadline 101010. They each eat one more piece in round 222, and Alice has no move in round 333.

For example, the eaten deadlines are 1,100,2,3,31,100,2,3,31,100,2,3,3, in that order. Alice eats the last piece in round 333, and Bob has no move.

For example, the eaten deadlines are 1,100,2,31,100,2,31,100,2,3, in that order. The remaining piece has deadline 222 and is discarded at the end of round 222. Alice has no move in round 333.