#571. 「Nowcoder多校 2019 Day2」Second Large Rectangle
「Nowcoder多校 2019 Day2」Second Large Rectangle
当前没有测试数据。
题目描述
Given a binary matrix. Please output the size of second large rectangle containing all .
Containing all means that the entries of the rectangle are all .
A rectangle can be defined as four integers where and . Then, the rectangle is composed of all the cell (x, y) where and . If all of the cell in the rectangle is , this is a valid rectangle.
Please find out the size of the second largest rectangle, two rectangles are different if exists a cell belonged to one of them but not belonged to the other.
输入格式
The first line of input contains two space-separated integers N and M. Following N lines each contains M characters .
输出格式
Output one line containing an integer representing the answer. If there are less than 2 rectangles containning all "1"\texttt{"1"}"1", output .
样例
样例输入 1
1 2
01
样例输出 1
0
样例输入 2
1 3
101
样例输出 2
1
数据范围与提示
1≤N,M≤1000