Type: Default 1000ms 256MiB

1

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Problem Description

给定 nn 行 mm 列的 0101 矩阵,输出能找到的最大的一个全 11 子矩阵,输出它的面积。

Input Format

第一行一个数 TT 表示数据组数。

接下来 TT 组数据,第一行两个数,nn 和 mm,接下来 nn 行,每行 mm 个数字。

Output Format

输出 TT 行,每行输出一个数,表示最大面积。

Sample

1
5 6
1 1 1 1 1 0
1 0 1 1 1 1
1 0 1 1 1 1
1 1 0 1 1 1
1 1 1 1 0 1
9

Hint

n,m≤1000,∑n,∑m≤5000n,m\le 1000,\sum n,\sum m\le 5000