问题3734--The Table

3734: The Table

[命题人 : ]
时间限制 : 2.000 sec  内存限制 : 64 MB

题目描述

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 Ai (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.

输入

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.

输出

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.

样例输入 Copy

3 3
20 10 30
15 20 20
30 30 20
3 2
2 -2 2
2 -2 2

样例输出 Copy

3
3

来源/分类