#t145. 排兵布阵

排兵布阵

Troop Deployment

Problem Description

As a general, you naturally need to deploy your troops sensibly. The map can be viewed as an n×mn \times m grid; a cell suitable for deploying troops is marked 1, and an unsuitable cell is marked 0. Now you must choose a rectangular region on the map to deploy troops, and this rectangle must not contain any unsuitable cell. What is the maximum number of cells such a rectangle can contain?

Input Format

The first line contains two positive integers nn and mm, the numbers of rows and columns of the map grid. The following nn lines each contain mm integers ai,1,ai,2,…,ai,ma_{i,1}, a_{i,2}, \ldots, a_{i,m}, indicating whether each cell is suitable for deploying troops.

Output Format

One line: one integer, the maximum number of cells in a troop-deployment rectangle.

Sample Input

Sample Input 1

4 3
0 1 1
1 0 1
0 1 1
1 1 1

Sample Input 2

3 5
1 0 1 0 1
0 1 0 1 0
0 1 1 1 0

Sample Output

Sample Output 1

4

Sample Output 2

3

Sample Explanation

For sample 1, the map is:

0 1 1
1 0 1
0 1 1
1 1 1

You can choose the rectangle from row 33 to row 44 and column 22 to column 33. All cells in it are 1, and its area is 2×2=42 \times 2 = 4. So the maximum is 44 cells.

Constraints

For all test points, 1≤n,m≤121 \le n, m \le 12, 0≤ai,j≤10 \le a_{i,j} \le 1.