Each test contains multiple test cases. The first line contains the number of test cases $T$($1\le T \le 10$). Description of the test cases follows.
The first line of each test case contains two integers $N,M$
The next $N$ lines each line contains two integers $x_i,y_i$
It’s guaranteed there are no $i,j(i \neq j)$ satisfies both $x_i=x_j$ and $y_i=y_j$
$1\le N \le 2000,1\le M \le 10^5,1\le x_i,y_i\le M$