F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Alice and Bob

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 2441    Accepted Submission(s): 864


Problem Description
Alice and Bob like playing games.

There are $m$ numbers written on the blackboard, all of which are integers between $0$ and $n$.

The rules of the game are as follows:

If there are still numbers on the blackboard, and there are no numbers with value $0$ on the blackboard, Alice can divide the remaining numbers on the blackboard into two sets.

Bob chooses one of the sets and erases all numbers in that set. Then subtract all remaining numbers by one.

At any time, if there is a number with a value of $0$ on the blackboard, Alice wins; otherwise, if all the numbers on the blackboard are erased, Bob wins.

Please determine who will win the game if both Alice and Bob play the game optimally.
 

Input
The first line contains an integer $T(T \le 2000)$ —the number of test cases.

The first line of each test case contains a single integers $n(1 \le \sum n \le 10^{6})$ .

The second line of each test case contains $n+1$ integers $a_0,a_1,a_2...a_n(0 \le a_i \le 10^{6} , \sum{a_i}=m)$ — there are $a_i$ numbers with value $i$ on the blackboard .
 

Output
For each test case, print "Alice" if Alice will win the game, otherwise print "Bob".
 

Sample Input
2 1 0 1 1 0 2
 

Sample Output
Bob Alice
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 10:36:47, Gzip enabled