프로그램 명: ceoi_logs
제한시간: 1 초

Given an N x M binary matrix, find the area of the biggest rectangle consisting entirely of values of 1, knowing that you can permute the columns of the matrix.

Constraints

입력

The first line of the input will contain two integers separated by one space: N and M. The following N lines will contain M characters of 0 or 1, describing the matrix.

출력

The only line of the output will contain the area of the largest rectangle.

입출력 예

입력

10 6
001010
111110
011110
111110
011110
111111
110111
110111
000101
010101

출력

21 

By permuting the columns such that columns 2, 4 and 5 are adjacent you have a rectangle of area 21 (rows 2-8 and columns 2, 4, 5).
출처:ceoi/2009/

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]