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

GCD Game

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 1855    Accepted Submission(s): 594


Problem Description
Alice and Bob are playing a game.

They take turns to operate. There are $n$ numbers, $a_1$ , $a_2$ , ... , $a_n$. Every time, the player plays in 3 steps.
1.Arbitrarily chooses one number $a_i$.
2.Arbitrarily chooses another number $x$($1 \leq x < a_i$).
3. Replace the number $a_i$ with $gcd(a_i,x)$. Here, $gcd(u,v)$ refers to the $\textbf{Greatest Common Divisor}$ of $u$ and $v$.

When a player can not make a single move he/she loses the game. Alice moves the first and she asks you to tell her who will win the game if both player play optimally.
 

Input
The first line contains a number $T$($1 \leq T \leq 100$), the number of testcases.

For each testcase, there are two lines.
The first line contains one number $n$($1 \leq n \leq 10^6$).
The second line contains $n$ numbers $a_1$ , $a_2$ , ... , $a_n$($1 \leq a_i \leq 10^7$).

It is guaranteed that for all testcases, $\sum{n} \leq 10^6$.
 

Output
For each testcase, output the answer in one line. If Alice will win the game, print "Alice", otherwise print "Bob".
 

Sample Input
2 1 1 1 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-04-20 23:45:07, Gzip enabled