QOJ.ac

QOJ

Limite de temps : 6 s Limite de mémoire : 256 MB Points totaux : 100

#4445. 带交集的坠落

Statistiques

Alice 和 Bob 正在玩一个游戏,规则如下。

最初,平面上有 $w$ 条直线。Alice 和 Bob 轮流画新直线,总共进行 $m$ 轮(因此最后总共会有 $w + 2m$ 条直线)。Alice 先手,他们不能画平面上已经存在的直线。游戏结束后,这些直线会产生一些交点。如果交点的总数为奇数,则 Bob 获胜;否则,Alice 获胜。如果多条直线交于同一点,该交点仅计一次。

游戏目前处于白热化阶段,平面上已经有 $w + n$ 条直线。现在 Alice 和 Bob 非常专注,他们的大脑飞速运转,确保所做的每一个决定都是最优的。

所有的直线都应表示为 $y = kx + b$ 的形式,其中 $k$ 和 $b$ 为整数,且除了最初的 $w + n$ 条直线外,对 $k$ 和 $b$ 的取值范围没有限制。

这个游戏的结果很有趣。你能告诉我们最终谁会获胜吗?

输入格式

第一行包含一个整数 $T$ ($1 \le T \le 100$),表示测试用例的数量。每个测试用例:

第一行包含三个整数 $w, m, n$ ($0 \le w \le 5, 1 \le m \le 500, \sum m \le 1300, 0 \le n \le 2m$),含义如上所述。

接下来的 $w + n$ 行,每行包含两个整数 $k_i, b_i$ ($-10^6 \le k_i, b_i \le 10^6$),表示平面上的第 $i$ 条直线为 $y = k_ix + b_i$。

保证对于任意 $i \neq j$,满足 $k_i \neq k_j$ 或 $b_i \neq b_j$。

输出格式

对于每个测试用例,输出一行,包含一个字符串("Alice" 或 "Bob",不含引号),表示获胜者。

样例

输入 1

2
1 2 3
1 1
1 5
0 1
0 5
1 2 2
1 1
1 5
0 1

输出 1

Alice
Alice

说明

对于第一个测试用例,他们已经画了 3 条直线,现在轮到 Bob 画最后一条直线。但无论 Bob 画什么,交点的数量总是一个偶数。

对于第二个测试用例,第三条直线应由 Alice 画。她可以画一条直线 $y = 0x + 5$,使其与第一个测试用例的情况相同。

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.