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.
3 3 20 10 30 15 20 20 30 30 20 3 2 2 -2 2 2 -2 2
3 3
Migrated from old NTUJ.
SEERC 2010
No. | Testdata Range | Score |
---|