BETA

Difficulty Level:

Hard

Total Submissions: 281 Accuracy:

42.35%

Largest rectangle of 1’s with swapping of columns allowed
       

Given a matrix with 0 and 1’s, find the largest rectangle of all 1’s in the matrix. The rectangle can be formed by swapping any pair of columns of given matrix.

Input:

The first line of input contains an integer T denoting the number of test cases. 

First line of each test case contains two elements R and C.The following line contains R*C numbers each (representing the matrix).
Output:

print the max area in a new line for each test case.
Constraints:

1<=T<=100

1<=R,C<=15
Example:

Input:

2

2 3

1 1 1 0 1 1

2 2

1 0 1 1

Output:

4

2

** For More Input/Output Examples Use 'Expected Output' option **

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.