QOJ.ac

QOJ

時間限制: 4.0 s 記憶體限制: 512 MB 總分: 100 可 Hack ✓

#12837. 无聊的游戏

统计

Yong Chol 正在和他的弟弟玩一个游戏。游戏棋盘是一个 $N \times N$ 的网格。每个格子中都有一枚硬币,每枚硬币要么正面朝上,要么反面朝上。玩家轮流翻转硬币。在每一轮中,玩家选择一个正面朝上的格子 $(x, y)$ ($1 \le x, y \le N$),以及两个整数 $w$ 和 $h$ ($1 \le w \le x, 1 \le h \le y$)。随后,玩家观察以格子 $(x - w + 1, y - h + 1)$ 和 $(x, y)$ 为对角顶点的矩形区域,并翻转该矩形内的所有硬币,即正面变反面,反面变正面。

无法进行操作的玩家输掉游戏。

Yong Chol 觉得和弟弟玩这个游戏太无聊了,他想立刻结束游戏。但在那之前,Yong Chol 想知道如果双方从现在开始都采取最优策略,谁会获胜。棋盘可能非常大,因此其当前状态由一系列矩形给出,这些矩形的并集表示正面朝上的硬币所在的格子,其余所有格子中的硬币均为反面朝上。Yong Chol 即将进行下一步操作。你能帮他找出谁会获胜吗?

输入格式

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

每个测试用例的第一行包含两个整数:$N$(棋盘大小)和 $M$(矩形数量,$1 \le N \le 10^9, 1 \le M \le 10^5$)。

接下来的 $M$ 行,每行包含四个整数 $x_1, y_1, x_2, y_2$,表示矩形的两个对角顶点坐标 ($1 \le x_i, y_i \le N, x_1 \le x_2, y_1 \le y_2$)。

所有测试用例的 $M$ 之和不超过 $6 \cdot 10^5$。对于至少 90% 的测试用例,$M$ 小于 600。

输出格式

对于每个测试用例,如果 Yong Chol 获胜,输出 “Yong Chol”,否则输出 “Brother”。

样例

输入 1

2
3 2
1 2 1 3
2 1 3 1
2 1
1 1 2 2

输出 1

Brother
Yong Chol

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.