#P1565. 牛宫
牛宫
Description
AP "Shenniu" plans to build a gorgeous rectangular palace on an rectangular vacant lot.
Each cell of the lot has an elevation . AP wants the average elevation of his palace to be above sea level (assume sea level has height ). 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 and . Then follow lines, each containing numbers, describing the elevations .
Output Format
Output the maximum area of the palace.
3 2
4 0
-10 8
-2 -2
4
Hint
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号