#P2706. 巧克力
巧克力
Description
There is a chocolate box divided into cells; at position there are pieces of chocolate. On the night before gifting it, mice raided the box: some cells were looted and now have holes. So you—Wang 7's younger brother, Wang 9—must cut out a rectangular chocolate box from this battered box, such that it contains no looted cells and the total number of chocolates inside is as large as possible.
Input Format
The first line contains two integers . In line , the -th number denotes . If this number is , it means the cell at that position was looted.
Output Format
Output the maximum number of chocolates.
3 4
1 2 3 4
5 0 6 3
10 3 4 0
17
Hint
Example Explanation
The first three cells in the third row 10 3 4 form the rectangle with the maximum number of chocolates.
Constraints
For all the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号