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

28338번 - Lottery Games 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB44211744.737%

문제

You live in a lively town named Lottery Vegas where lots of different kinds of lottery games are available for you to play. Next to your house, you found an interesting lottery game that is called Double ticket winner ainu7 for the win, named after a really famous Miku-admirer.

The ainu7 lottery game consists of $P$ different lottery tickets. The i-th ticket contains numbers between 1ドル$ and $N_i,ドル inclusive, and you are to pick $M_i$ numbers out of them. The ainu7 lottery game seller also picks $M_i$ numbers while you are picking. For each lottery ticket, you win if you and the seller have at least $K_i$ numbers in common with the seller. You can assume that the seller picks the numbers at random, regardless of what you pick.

You are curious which of the $P$ tickets gives you the highest winning odds. If there are multiple such tickets with the same highest winning odds, you want to know them all.

입력

The input consists of $T$ test cases. The number of test cases $T$ is given in the first line of the input.

The first line of each test case contains a single integer $P$ (2ドル ≤ P ≤ 100$), the number of lottery tickets. Following $P$ lines contains three numbers each: $N_i,ドル $M_i,ドル and $K_i$ where 3ドル ≤ N_i ≤ 50,ドル 1ドル ≤ M_i ≤ N_i,ドル and 1ドル ≤ K_i ≤ M_i$.

출력

For each test case, you must output a single line of integer(s). It must contain the lottery game number(s) with highest winning odds. If there are multiple, you must sort them, and the game number is 1-based.

제한

예제 입력 1

2
4
3 1 1
8 2 1
8 4 2
8 3 1
7
8 7 1
8 7 2
8 7 3
8 7 4
8 7 5
8 7 6
8 7 7

예제 출력 1

4
1 2 3 4 5 6

힌트

출처

University > 전국 대학생 프로그래밍 대회 동아리 연합 > UCPC 2011 J번

  • 문제를 만든 사람: haden
(追記) (追記ここまで)

출처

대학교 대회

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

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