#P5943. [POI 2002] 最大的园地

[POI 2002] 最大的园地

Problem Description

In an n×nn \times n square, find the largest rectangle consisting only of 0, and output its area.

Input Format

The first line contains an integer nn.

The next nn lines each contain nn numbers describing the square.

Output Format

Output the area of the largest rectangle consisting only of 0.

5
0 1 0 1 0
0 0 0 0 0
0 0 0 0 1
1 0 0 0 0
0 1 0 0 0
9

Hint

For 100%100\% of the testdata, 1n20001 \le n \le 2000.

Translated by ChatGPT 5