

It is possible that a single candidate is interested in multiple jobs but he can take up only one of the job out of his favourable jobs, also there is no priority in jobs, i.e all favourable jobs are equally favourable to the candidate
The first line of input contains an integer ‘T’ representing the number of test cases. Then the test cases follow.
The first line of each test case contains 2 space-separated integers ‘M’ and ‘N’ which denote the number of applicants and number of jobs respectively.
The next ‘M’ lines have ‘N’ space-separated binary numbers which denote the favourable jobs of each applicant.
For each test case, return a single integer denoting the maximum number of applicants that got their favourable jobs
The output for each test case is in a separate line.
You do not need to print anything; it has already been taken care of. Just implement the given function.
1 <= T <= 100
1 <= M * N <= 3000
Time Limit: 1sec
0 1 1 0 0 0
1 0 0 1 0 0
0 0 1 0 0 0
0 0 1 1 0 0
0 0 0 0 0 0
0 0 0 0 0 1
We can take the following approach.