Defeat the Wrong Program

Find a cell in an n × m grid such that the sum of integers in the “cross shape” (a cell and all the cells in the same row or column) is maximized. If the answer is not unique, you can print any solution. In the example on the right: The best solution is (1,3), i.e. the intersection of the first row from above, and the 3rd column from left. The sum of integers in the cross-shape is 5*7 = 35. The problem above is from a local programming contest. After the contest data has been generated, one of the judges has come up with the following algorithm: Obviously, this algorithm does NOT guarantee a correct answer, but to their surprise, this program passed most judge data! Could you identify the ”weak” data so that the judges can improve these data? Input There will be at most 100 test cases. Each case begins with two integers n, m (1 ≤ n ≤ 500, 1 ≤ m ≤ 500), the number of rows and columns. Then n lines follow, each containing m integers between 1 and 100. The whole input size does not exceed 2MB. Output For each test case, print the case number and ‘Weak’ or ‘Strong’. Sample Input 44 5555 1151 1151 1151 54 2511 1191 1111 1111 1111 Sample Output Case 1: Weak Case 2: Strong First, find a row r (1 ≤ r ≤ n) with the maximum sum, then find a column c (1 ≤ c ≤ m) with the maximum sum, and finally output (r, c). If there is a tie, print the smallest r and/or c.