To thank his laborer Frank for taking care of himself for years, the old farmer Bob promised that Frank could ride a horse to enclose his own farm in an hour, and the land in the enclosure would belong to Frank. But it troubles Frank that there was a stable in Bob's farm, and the land occupied by the stable could not be used to cultivate, and there was no way to ride through the stables, and even if he had completely enclosed the stable, Bob will not attribute the stable to Frank.
In order to get more land, Frank has simplified and abstracted the problem:
1. The farm is a n * m square matrix
2. The route of riding is a closed line along the edge of the box
3. The stable is a rectangle in the matrix. Because there is only one hour, so the riding circumference does not exceed L.
Frank would like to know the maximum area of land he can enclose (the stable area is not counted).
as the figure shows:
Figure 1 is a valid route;
Figure 2 is also a valid route, but the area of land is 0;
Figure 3 is not a valid route, because it is not closed;
Figure 4 is not a valid route, because through the stables.
2 4 4 8 1 3 1 3 7 2 5 0 1 5 7
3 1
01 Use "long long" to calculate the answer
05 Expected Value of an Expression: Ai is less than 2^20