The Table
Easy
Execution time limit is 10 seconds
Runtime memory usage limit is 64 megabytes
Consider the table of 32-bit signed integers with n rows and m columns. The columns are numbered from 1 to m beginning from the left side of the table. Let A_i (1 ≤ i ≤ m) is the product of all numbers in the i-th column. Find the maximum of these products and print the column number where this maximum product is achieved. If there are many such columns, print the largest number of the column.
Input
Consists of multiple tests. Each test begins with a line with two integers m and n (1 ≤ m ≤ 20, 1 ≤ n ≤ 1000). Each of the next n lines contains m 32-bit signed integers. Output
For each test case print on a separate line the column number with the maximum product. If there are several of them – print the largest number of such column.
Examples
Input #1
Answer #1
Submissions 350
Acceptance rate 9%