#T289. 最大子矩阵

最大子矩阵

Description

The size of a matrix is defined as the sum of all its elements. Given a matrix, your task is to find the largest non-empty (with a size of at least 1×1) submatrix.
Maximum Matrix.jpg

Input Format

The input is an N×N matrix. The first line of input gives N (0 < N ≤ 100).
In the subsequent lines, the N² integers of the matrix are provided sequentially (first the N integers of the first row from left to right, then the N integers of the second row from left to right, and so on). The integers are separated by whitespace characters (spaces or blank lines).
It is known that the integers in the matrix range within [−127, 127].

Output Format

Output the size of the largest submatrix.

  0  -2   -7   0

  9   2   -6   2 

-4    1   -4   1

-1    8    0  -2

  9   2

-4   1

-1   8