Under construction

Still being built. Things may change

General Election

Interview

Time limit2sMemory limit512 MB

Summary
Sum each candidate's votes across regions and print the candidate number with the largest total.
Level

Easy1 of 10

Topics
Array, Implementation
Solved
No attempts yet

Problem

The general election is over, and 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 each candidate received in each region, determine the winner, the candidate with the most votes.

Input

The first line of input contains an integer T, the number of test cases.

Each test case starts with an integer N and an integer M, the number of candidates and the number of regions. The next M lines each contain N integers, v1, v2, ..., vN (0 <= vi <= 1000), the number of votes for candidate i.

Output

For each test case, output the number of the winning candidate on a line. You may safely assume that the winner is unique.

Examples1

  1. Example 1

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