1556.Alice Game

Time Limit: 1s Memory Limit: 256MB

Alice and Bob are playing a game.

There are $n$ monsters in the game, and they stand in a line. Alice and Bob take turns. Each turn, the player can choose one of two actions:

  1. Destroy a consecutive monster sequence of size less than or equal to $K$. Note that you must destroy all monsters in the continuous sequence of your choice.

  2. Select $K$ consecutive monsters to destroy, and after destroying these $K$ monsters, the sequential monster sequence in which they were originally located must be divided into two non-empty sequences. The two remaining sequences will not be considered continuous.

Here is an example of operation $2$, if $K=2$ and there are four monsters $ABCD$ in the field. Now we can destroy monsters $BC$ because they are continuous, and after destroying them we can be left with monsters $AeeD$ ($e$ means the area is empty). But we cannot destroy the monster $AB$ or $CD$, because the remaining two sequences must be non-empty (in fact, if we do this, only one continuous sequence remains). Similarly, we can't destroy monsters $AC$ or $BD$ because monsters $A$ and $C$ are not continuous.

When a player cannot operate, he loses. Now, Alice will play the game first. She wants to know, can she win at this game?

Input Format(From the terminal/stdin)

An integer $T$ indicates that there are $T$ groups of data.

Next $T$ rows. Enter two integers $K$ and $n$ on each line.

Guarantee $1≤T≤10000,2≤K≤10^7,0≤n≤10^9$.

Output Format(To the terminal/stdout)

Output total $T$ lines.

If Alice can win, output "Alice", otherwise output "Bob".

Sample Input

Copy
2
2 2
2 3
 \n
 · \n
 · \n

Sample Output

Copy
Alice
Bob
     \n
   \n
Source: 2023“钉耙编程”中国大学生算法设计超级联赛(2)

Submit

请先 登录

© 2025 FAQs