Lottery Games
면접 대비시간 제한1초메모리 제한1024 MB
P개의 복권 각각에 대해 판매자가 무작위로 고른 M_i개 수가 내가 고른 수와 K_i개 이상 겹칠 확률을 계산하고, 그 확률이 가장 높은 복권 번호를 모두 출력한다.
문제
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 different lottery tickets. The i-th ticket contains numbers between and , inclusive, and you are to pick numbers out of them. The ainu7 lottery game seller also picks numbers while you are picking. For each lottery ticket, you win if you and the seller have at least 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 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 test cases. The number of test cases is given in the first line of the input.
The first line of each test case contains a single integer (), the number of lottery tickets. Following lines contains three numbers each: , , and where , , and .
출력
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.