시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 512 MB62251432.558%

문제

We are given a square-shaped field. The field has a side of length n and it is divided into n^2 squares of side 1. Each square is either arable or waste land. We delimit a parcel in the field. The parcel ought to be a rectangle and to consist of only arable squares. The area of the parcel is equal to the area of the corresponding rectangle. We seek for a parcel of the largest area.

Write a program which:

  • reads from the standard input the description of the field,
  • computes the area of the largest parcel (there may be more than one such a parcel),
  • writes to the standard output the computed area.

입력

In the first line of the standard input there is one integer n, 1 ≤ n ≤ 2,000. In the successive n lines there are descriptions of squares that compose successive rows of the field. Each of those lines comprises n numbers 0 or 1, separated by single spaces. The numbers describe successive squares in the row: 0 denotes an arable square and 1 denotes a waste square.

출력

Your program should write one integer in the first and only line of the standard output. The number should be the area of the largest parcel. If all the squares are waste and there is no parcel, your program should give the answer 0.

예제 입력 1

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

예제 출력 1

9