QOJ.ac

QOJ

時間限制: 1.0 s 記憶體限制: 1024 MB 總分: 100

#10022. 跳跃游戏

统计

这个游戏规则很简单。

有一个 $r$ 行 $c$ 列的棋盘,上面有一枚国际象棋的马。从上往下第 $i$ 行、从左往右第 $j$ 列的格子被称为方格 $(i, j)$。初始时,马位于方格 $(r_s, c_s)$。

Annapurna 和 Brahma 轮流执行以下操作,由 Annapurna 先手:

  • 将马移动到棋盘上自游戏开始以来从未访问过的方格之一。请记住,马可以从 $(x_1, y_1)$ 移动到 $(x_2, y_2)$ 当且仅当 $(x_1 - x_2)^2 + (y_1 - y_2)^2 = 5$。

无法移动马的玩家输掉游戏,其对手被宣布为获胜者。确定如果双方都采取最优策略,是 Annapurna 还是 Brahma 会获胜。

输入格式

第一行包含一个整数 $t$:测试用例的数量 ($2 \le t \le 2 \cdot 10^5$)。

接下来的 $t$ 行中,每行包含四个整数 $r, c, r_s$ 和 $c_s$:分别表示棋盘的行数和列数,以及马的起始行和起始列 ($1 \le r, c \le 10^9$; $1 \le r_s \le r$; $1 \le c_s \le c$)。

输出格式

输出 $t$ 行。在第 $i$ 行,打印第 $i$ 个测试用例的获胜者姓名:Annapurna 或 Brahma。

样例

输入 1

2
6 6 6 6
7 19 7 3

输出 1

Annapurna
Brahma

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.