Boring Game

TimeLimit:5000MS  MemoryLimit:153428KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
YongChol is playing a game with his brother. The board is a N*N grid filled with coins. The players take turns to flip coins.
In each turn, the player selects a cell (x, y) (1 <= x, y <= N) with a coin facing up and two integers w, h (1 <= w <= x, 1 <= h <= y), and flips all coins inside the rectangle which bottom-right cell is (x, y) and top-left cell is (x – w + 1, y – h + 1).
The player who cannot move any more loses.
The game with his little brother is so boring that he wants to finish the game immediately. YongChol wants to know who will win the game if the two players play optimally from now on.
In consideration of the large size of the board, initial board state is given with a list of rectangles, the union of which represents the cells with a coin facing up.
YongChol is to take the next move. Can you help him?
Input
The first line of input contains an integer T(1<=T<=200), the number of test cases.
Each test case begins with two integer N (1<=N<=1e9), M(1<=M<=100000), the size of the board and the number of rectangles respectively.
The next M lines each contains 4 integers, x1,y1,x2, y2(1<=xi,yi<=N), the coordinates of the top-left and bottom-right corner of the rectangle.
The total sum of M over all test cases will not exceed 600000.
For 90% of the test cases, M will be smaller than 600.
Output
If YongChol wins the game, print “YongChol” and otherwise print “Brother” in a line for each test case.
SampleInput
2
3 2
1 2 1 3
2 1 3 1
2 1
1 1 2 2
SampleOutput
Brother
Yong Chol
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: