Codeforces Round 726 (Div. 2)
D
Deleting Divisors
Codeforces
1700
原题
← CE1 →
翻译中…

Alice and Bob are playing a game.

翻译中…

They start with a positive integer $n$ and take alternating turns doing operations on it. Each turn a player can subtract from $n$ one of its divisors that isn't $1$ or $n$. The player who cannot make a move on his/her turn loses. Alice always moves first.

翻译中…

Note that they subtract a divisor of the current number in each turn.

翻译中…

You are asked to find out who will win the game if both players play optimally.

翻译中…

Input

翻译中…

The first line contains a single integer $t$ ($1 \leq t \leq 10^4$) — the number of test cases. Then $t$ test cases follow.

翻译中…

Each test case contains a single integer $n$ ($1 \leq n \leq 10^9$) — the initial number.

翻译中…

Output

翻译中…

For each test case output "Alice" if Alice will win the game or "Bob" if Bob will win, if both players play optimally.

翻译中…

Note

翻译中…

In the first test case, the game ends immediately because Alice cannot make a move.

翻译中…

In the second test case, Alice can subtract $2$ making $n = 2$, then Bob cannot make a move so Alice wins.

翻译中…

In the third test case, Alice can subtract $3$ so that $n = 9$. Bob's only move is to subtract $3$ and make $n = 6$. Now, Alice can subtract $3$ again and $n = 3$. Then Bob cannot make a move, so Alice wins.

翻译中…

样例

Input #1
4
1
4
12
69
Output #1
Bob
Alice
Alice
Bob
InputCopy OutputCopy
题目信息
题号
1537D
时间限制
2 s
内存限制
256 MB
标签
博弈论
数学
数论

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