There is an integer T (1 <= T <= 200) in the first line, which indicates that there are T test cases in total.
For each test case, there are three integers N (1 <= N <= 1000000000), M (1 <= M <= 1000000000), K (0 <= K <= 100, K <= N * M). N and M have the same meanings as above. K means there are exactly K unit squares which have value 1 on it, surely that the other unit squares have value 0 on it. Then there are following K lines and each line has two integer x (1 <= x <= N), y (1 <= y <= M), means that the unit square in row x and column y has value 1 on it. You can assume that no two pairs of x and y are the same.
There are at most 10 test cases that satisfy N > 100 or M > 100 or K > 15.