Given atwo-dimensional array of positive and negative integers, a sub-rectangle is
any contiguous sub-array of size 1 x 1or greater located withinthewhole array.
The sumofa rectangle is thesumof all the elements in that rectangle. In this
problem the sub-rectangle withthe largest sum is referred toasthe maximal sub-
rectangle.
As an example, the maximal sub-rectangle ofthe array:
0 -2 -7092 -62
-41 -41
-180 -2
is inthelower left corner:
92
-41
-18and has asumof15.
Input
he input consists of an N x N array of integers. The input begins with a single
positive integer N on a line by itself, indicating the size ofthe square two-
dimensional array. This is followed by N 2 integers separated by whitespace (spaces
and newlines). These are the N 2 integers ofthe array, presented in row-major
order. That is, all numbers inthefirst row, left to right, then all numbers inthesecond row, left to right, etc. N may be as large as100. The numbers inthe
array will be inthe range [-127,127].