Given a M*N integer array, please output the smallest column-sum and row-sum.
There are multiple test cases. Each case starts with two integers M and N in a line. Then a M*N integer array follows. Integers are separated by blank. All the numbers in the array are in the range [-107, 107]. Please see the sample input.
Case 1: 1 <= M, N <= 10
Case 2: 1 <= M, N <= 100
Case 3: 1 <= M, N <= 1000
Case 4: 1 <= M, N <= 100000, 1 <= M*N <= 1000000
Note : Don't use cin/cout for input/output.
For each case, output the smallest column-sum and row-sum in a line, separated by a blank.