cho.sh
Notes
Loading...

Largest Zero Submatrix

Time limit

2s

Memory limit

128 MB

Problem

You are given an N x M matrix containing only 0 and 1. Choose a rectangular submatrix made of consecutive rows and columns whose every cell is 0. Print the largest possible area of such a submatrix.

Input

The first line contains two integers N and M. (1 <= N, M <= 333) Each of the next N lines contains a string of length M. Each character is 0 or 1 and represents one cell of the matrix without spaces.

Output

Print the maximum area of a submatrix whose cells are all 0.