Logo
(追記) (追記ここまで)

19103번 - Boring Game 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 512 MB90171016.667%

문제

Yong Chol is playing a game with his brother. The game board is a $N \times N$ grid. Each cell of the grid contains a coin. Each coin is either heads up or tails up. The players take turns to flip coins. In each turn, the player selects a cell $(x, y)$ (1ドル \le x, y \le N$) with a coin heads up, and also two integers $w$ and $h$ (1ドル \le w \le x,ドル 1ドル \le h \le y$). After that, the player looks at the rectangle of cells with its opposite corners containing cells $(x - w + 1, y - h + 1)$ and $(x, y),ドル and flips all coins in this rectangle, changing heads to tails and vice versa.

The player who cannot make a move loses the game.

The game with his little brother is so boring for Yong Chol that he wants to finish it immediately. But before doing that, Yong Chol wants to know who will win if the two players play optimally from now on. The board may be rather large, so its current state is given as a list of rectangles such that their union represents the cells with a coin heads up, and all other cells contain a coin tails up. Yong Chol is to take the next move. Can you help him find out who will win?

입력

The first line of input contains an integer $T,ドル the number of test cases (1ドル \le T \le 200$).

Each test case starts with a line containing two integers: $N,ドル the size of the board, and $M,ドル the number of rectangles (1ドル \le N \le 10^9,ドル 1ドル \le M \le 10^5$).

Each of the next $M$ lines contains four integers $x_1,ドル $y_1,ドル $x_2,ドル and $y_2$: the coordinates of the two opposite corners of the rectangle (1ドル \le x_i, y_i \le N,ドル $x_1 \le x_2,ドル $y_1 \le y_2$).

The total sum of $M$ over all test cases will not exceed 6ドル \cdot 10^5$. For at least 90ドル$ percent of the test cases, $M$ will be smaller than 600ドル$.

출력

For each test case, if Yong Chol wins the game, print "Yong Chol", otherwise print "Brother".

제한

예제 입력 1

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

예제 출력 1

Brother
Yong Chol

힌트

출처

Camp > Petrozavodsk Programming Camp > Summer 2017 > Day 7: DPRK Contest 2 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /