QOJ.ac

QOJ

Time Limit: 2.0 s Memory Limit: 256 MB Total points: 100 Hackable ✓

#11768. 不公平的游戏

Statistics

Alice 和 Bob 在一个 $1 \times n$ 的棋盘上玩游戏。Alice 的回合中,她在棋盘上放置一个 $1 \times a$ 的瓷砖;Bob 的回合中,他在棋盘上放置一个 $1 \times b$ 的瓷砖。瓷砖必须放置在未被占据的格子上,且不能重叠。

无法进行移动的玩家输掉游戏。

Alice 先手。为了补偿先手的优势,Alice 的瓷砖比 Bob 的大(换句话说,$a > b$)。给定三个整数 $a$、$b$ 和 $n$,若双方都采取最优策略,确定谁将赢得游戏。

输入格式

第一行包含一个整数 $t$ ($1 \le t \le 10^5$),表示测试用例的数量。

接下来的 $t$ 行,每行包含三个空格分隔的整数 $a$、$b$ 和 $n$ ($1 \le b < a \le n \le 10^9$),分别表示 Alice 和 Bob 使用的瓷砖大小以及棋盘的长度。

输出格式

对于每个测试用例,如果 Alice 获胜,输出 “Alice”;如果 Bob 获胜,输出 “Bob”。

样例

输入格式 1

3
10 1 10
5 1 10
7 4 20

输出格式 1

Alice
Bob
Bob

说明

在第一个样例中,由于 Alice 先手且 $a = n = 10$,她可以在第一步就填满整个棋盘,Bob 将没有合法的移动,从而输掉游戏。

Figure 1. Alice's first move in the first sample case

在第二个样例中,Alice 无法阻止 Bob 在他的第一回合放置瓷砖。在 Bob 的第一回合之后,总共只剩下 4 个空方格,因此 Alice 在她的第二回合无法放置瓷砖,从而输掉游戏。

Figure 2. Alice's turn in the second sample case

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.