**Problem Description**

Input

The first line contains one integer T(T<=15),represents the number of testcases;

For each test case:

The first line contains two integer n,m(1<=n,m<=1000)

then have n row m column represents the cake(only contains 0 and 1).

**Output**

Each line output one number represents the biggest cake that Tianyi_CHN can eat.

**Sample Input**

1 5 6 011111 111111 000111 111111 111111

**Sample Output**

15

**Source**

2017绍兴市技能竞赛