Maximum sum
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given a table with integers of size . Find in it the rectangle with maximum sum. For example, in the table
the rectangle with maximum sum is
Sum of its elements equals to .
Input
First number is the size of the table. Then integers are given that describes the table. It is known that all numbers are integers in the range . It is known that the table contains at least one nonnegative integer.
Output
Print the maximum sum in rectangle.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 37%