Rectangular Dry Land
시간 제한7초메모리 제한1024 MB
0은 마른 땅, 1은 습지인 격자가 주어질 때, 모두 0으로만 이루어진 가장 큰 직사각형의 넓이를 구한다.
문제
There are a lot of wetlands in Florida and finding space for building houses is a challenge. This problem is even more serious when people insist their houses to be rectangular shapes.
Let’s assume our land is a two-dimensional (rectangular) grid and each grid cell is either wet or dry. We are interested in finding the largest rectangular dryland, i.e., we want to build the largest house (in area). Note that the house must be dryland in rectangular shape, i.e., the dry cells (area to build the house) must be rectangular and there can’t be any wet cells in that rectangle.
입력
The first input line contains two integers: r (1 ≤ r ≤ 200), indicating the number of rows in our land and c (1 ≤ c ≤ 200), indicating the number of columns in our land. Each of the next r input lines specifies a row in the land; each line contains c characters (starting in column 1), each character being either 1 (wetland) or 0 (dryland).
출력
Print the area of the largest rectangular dryland.