{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eGiven a \u003ci\u003em\u003c/i\u003e-by-\u003ci\u003en\u003c/i\u003e (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By \u003ci\u003elargest\u003c/i\u003e we mean that the submatrix has the most elements.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eThe input contains multiple test cases. Each test case begins with \u003ci\u003em\u003c/i\u003e and \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003em\u003c/i\u003e, \u003ci\u003en\u003c/i\u003e ≤ 2000) on line. Then come the elements of a (0,1)-matrix in row-major order on \u003ci\u003em\u003c/i\u003e lines each with \u003ci\u003en\u003c/i\u003e numbers. The input ends once EOF is met.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cdiv class\u003d\"ptx\" lang\u003d\"en-US\"\u003e\u003cp\u003eFor each test case, output one line containing the number of elements of the largest submatrix of all 1’s. If the given matrix is of all 0’s, output 0.\u003c/p\u003e\u003c/div\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e2 2\n0 0\n0 0\n4 4\n0 0 0 0\n0 1 1 0\n0 1 1 0\n0 0 0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre class\u003d\"sio\"\u003e0\n4\u003c/pre\u003e"}},{"title":"Template","value":{"format":"HTML","content":"\u003cpre\u003e\n\u003ccode\u003e\nfrom sys import stdin\n\ndef solve(matrix):\n # write your code here\n \n return 0\n\nwhile True:\n line \u003d stdin.readline().strip()\n\n if not line:\n quit()\n\n M, N \u003d (int(x) for x in line.split())\n matrix \u003d [[int(x) for x in stdin.readline().split()] for i in range(M)]\n\n print(solve(matrix))\n\u003c/pre\u003e\n\u003c/code\u003e"}}]}