Codeforces Round 221 (Div. 2)
D
Maximum Submatrix 2
Codeforces
未评级
原题
← CE →
翻译中…

You are given a matrix consisting of digits zero and one, its size is $*n* × *m*$. You are allowed to rearrange its rows. What is the maximum area of the submatrix that only consists of ones and can be obtained in the given problem by the described operations?

翻译中…

Let's assume that the rows of matrix $*a*$ are numbered from 1 to $*n*$ from top to bottom and the columns are numbered from 1 to $*m*$ from left to right. A matrix cell on the intersection of the $*i*$-th row and the $*j*$-th column can be represented as $(*i*, *j*)$. Formally, a submatrix of matrix $*a*$ is a group of four integers $*d*, *u*, *l*, *r*$ $(1 ≤ *d* ≤ *u* ≤ *n*; 1 ≤ *l* ≤ *r* ≤ *m*)$. We will assume that the submatrix contains cells $(*i*, *j*)$ $(*d* ≤ *i* ≤ *u*; *l* ≤ *j* ≤ *r*)$. The area of the submatrix is the number of cells it contains.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*m*$ $(1 ≤ *n*, *m* ≤ 5000)$. Next $*n*$ lines contain $*m*$ characters each — matrix $*a*$. Matrix $*a*$ only contains characters: "0" and "1". Note that the elements of the matrix follow without any spaces in the lines.

翻译中…

Output

翻译中…

Print a single integer — the area of the maximum obtained submatrix. If we cannot obtain a matrix of numbers one, print 0.

翻译中…

样例

Input #1
1 1
1
Output #1
1
InputCopy OutputCopy
Input #2
2 2
10
11
Output #2
2
InputCopy OutputCopy
Input #3
4 3
100
011
000
101
Output #3
2
InputCopy OutputCopy
题目信息
题号
376D
时间限制
2 s
内存限制
512 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。