Maximum sum#2613

Maximum sum

1 second
128 megabytes
Easy

Given a table of size n \times n consisting of integers. It is required to find the rectangle within the table that has the maximum sum of its elements. For example, in the table

the rectangle with the largest sum is

The sum of its elements is .

Input

The first line contains the integer n~(n \le 500) — the size of the table. Then n^2 integers are given, describing the table row by row. All numbers are in the range . It is guaranteed that the table contains at least one nonnegative integer.

Output

Print the value of the maximum sum in a rectangle within the table.

Examples

Example 1

Loading
Loading