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

23509번 - Aunts 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
7 초 (추가 시간 없음) 128 MB73375.000%

문제

The organizing comittee of this contest is made from a bunch of slackers who's rather do anything than prepare a contest. As a result of this, $N$ of them reported that they have to bring some medicine to their aunt, so that they can get away without doing anything. All of their aunts live within a $A\times B$ matrix. They all report their absence to Dzoni, who takes a note of the cell that their aunt's house is located as well as the altitude it's located in. Dzoni doesn't know the actual altitudes, but he knows that in every two adjacent cells in the matrix, the absolute difference of their altitudes is exaclty 1. Having this in mind, after every claim made by a member of the organizing comittee he tries to reconstruct all the altitudes, meaning that he will check if its possible to assign each cell with an altitude so that all of the reports are true. If after some report, Dzoni is unable to reconstruct the altitudes (and since it's Dzoni, if it's possible, he'll be able to do it), it's obvious that the organizing comittee member that just made the report said something really stupid. Your job is to find the member who said something really stupid.

입력

In the first line of the input there are three integers $N,ドル $A$ and $B$ denoting the number of comittee members ($N\leq10^5$), the number of rows and the number of columns of the matrix ($A,B\leq10^9$).

In each of the following $N$ lines, there are three integers $R_i,ドル $C_i$ and $H_i$ denoting the row, column ($R_i\le A, C_i\le B$) and altitude (1ドル \le H_i \le 10^8$) of the $i$-th organizing comittee's alleged aunt's house.

출력

In the first and only line write the index of the comittee member who said something really stupid (comittee members are indexed from 1ドル$). If such a member doesn't exist, print "bravo komisijo" (meaning "congratulations, ogranizing comittee" in Serbian) without the quotation marks.

제한

예제 입력 1

4 3 5
1 2 1
2 1 3
2 5 21
2 2 8

예제 출력 1

3

힌트

출처

Contest > Open Cup > 2019/2020 Season > Stage 19: The Grand Prix of Serbia K번

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

출처

대학교 대회

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

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