You have been tasked by your city council with creating a soccer court in your local park. You go over to the park to investigate.
The park consists of a rectangle-shaped region consisting of a grid of grass squares. Each square has a grass speed of
representing how fast the ball will roll through that cell.
A valid court consists of an axis-aligned subrectangle of the park with integer height and even width. This court will be split into equally-sized halves by a vertical line to create an offensive zone and a defensive zone for each team. To allow for construction of spectator seating, the court cannot be rotated and the midline must be vertical. The court must also satisfy one additional constraint - to ensure each team has an equal offensive advantage, the sum of the grass speeds in each of the two halves must be the same.
Of course there may be more than one possible valid court within the park. To maximize player capacity, you will choose a court with maximum area.
Given this information, calculate the size of the court that you will pick out. If there is no valid court, output 0
instead.
Constraints
Input Specification
The first line contains two integers and
: the height and width of the park respectively.
The next lines contain
integers each, representing the grass speed
.
Output Specification
Output a single integer - the maximum possible area of a valid court.
If no valid court exists, output .
Sample Input 1
4 6
1 2 3 4 5 6
2 3 4 5 6 7
9 9 7 5 1 1
8 8 7 7 6 6
Sample Output 1
18
Sample Input 2
7 5
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
10 10 11 10 10
10 10 10 10 10
10 10 10 10 10
10 10 10 10 10
Sample Output 2
14
Comments