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

16175번 - General Election 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB49839935479.018%

문제

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.

제한

예제 입력 1

2
3 3
159 213 450
512 890 993
215 420 397
2 5
40 64
35 12
102 58
43 15
79 41

예제 출력 1

3
1

힌트

출처

ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2009 A번

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

출처

대학교 대회

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

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