아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Lottery Games

면접 대비

시간 제한1초메모리 제한1024 MB

요약
P개의 복권 각각에 대해 판매자가 무작위로 고른 M_i개 수가 내가 고른 수와 K_i개 이상 겹칠 확률을 계산하고, 그 확률이 가장 높은 복권 번호를 모두 출력한다.
난이도

보통10점 중 6점

유형
조합론, 수학, 확률, 구현
정답자
아직 제출이 없습니다

문제

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 PP different lottery tickets. The i-th ticket contains numbers between 11 and N_iN\_i, inclusive, and you are to pick M_iM\_i numbers out of them. The ainu7 lottery game seller also picks M_iM\_i numbers while you are picking. For each lottery ticket, you win if you and the seller have at least K_iK\_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 PP 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 TT test cases. The number of test cases TT is given in the first line of the input.

The first line of each test case contains a single integer PP (2≤P≤1002 ≤ P ≤ 100), the number of lottery tickets. Following PP lines contains three numbers each: N_iN\_i, M_iM\_i, and K_iK\_i where 3≤N_i≤503 ≤ N\_i ≤ 50, 1≤M_i≤N_i1 ≤ M\_i ≤ N\_i, and 1≤K_i≤M_i1 ≤ 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

  1. 예제 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
    
    예상 출력
    4
    1 2 3 4 5 6