#P1565. 牛宫

牛宫

Description

AP "Shenniu" plans to build a gorgeous rectangular palace on an N×MN \times M rectangular vacant lot.

Each cell of the lot has an elevation ai,ja_{i,j}. AP wants the average elevation of his palace to be above sea level (assume sea level has height 00). He also wants the palace to be as large as possible to accommodate more people to worship him. The palace must occupy a contiguous axis-aligned rectangle of cells. What is the maximum possible area of the palace?

Input Format

The first line contains NN and MM. Then follow NN lines, each containing MM numbers, describing the elevations ai,ja_{i,j}.

Output Format

Output the maximum area of the palace.

3 2
4 0
-10 8
-2 -2

4

Hint

For 50%50\% of the testdata, N,M100N,M \le 100.

For 100%100\% of the testdata, 1N,M2001 \le N,M \le 200, 2×109ai,j16315-2\times10^9 \le a_{i,j} \le 16315.

Translated by ChatGPT 5