시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 301 | 241 | 218 | 78.417% |
General Election is over, now it is time to count the votes! There are N (2 <= N <= 5) candidates and M (1 <= M <= 100) vote regions. Given the number of votes for each candidate from each region, determine which candidate is the winner (one with the most votes).
The first line of input contains an integer T, the number of test cases follow.
Each test case starts with an integer N and M denoting the number of candidate and number of region. The next M lines each contains N integers, v1, v2, ..., vN (0 <= vi <= 1000) the number of votes for candidate i.
For each test case, output in a line the winning candidate. You may safely assume that the winner is unique.
2 3 3 159 213 450 512 890 993 215 420 397 2 5 40 64 35 12 102 58 43 15 79 41
3 1
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2009 A번