#Lutece1455. Master Zhu
Master Zhu
Migrated from Lutece 1455 Master Zhu
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Input
There are multiple test cases. The first line of input contains an integer T, indicating the number of test cases.
For each test case,The first line contains two integers and -- the number of rows and column. For the next n lines,each line two integers .
Output
For each test case, output the min minimum number of chessmans he should place.
Samples
3
3 3
1 1
2 2
3 3
2 4
1 3
2 4
3 2
1 2
1 2
1 2
3
2
2
Resources
2016 Multi-University Training Contest 6