## 几队周尼玛？

eg：1 2

2 4

周尼玛2号和周尼玛4号是一队的

The input starts with an integer T(1<=T<=10) which indicate the number of test cases. Then T test cases follow. Each test case starts with two integers N and M(1<=N<= 30000,1<=M<= 500000). N indicates the number of 周尼玛, the 周尼玛 are marked from 1 to N. Then M lines follow. Each line consists of two integers A and B(A!=B), that means 周尼玛 A and 周尼玛 B in the same team. There will be a blank line between two cases.

For each test case, just output how many tables Ignatius needs at least. Do NOT print any blanks.

2
5 3
1 2
2 3
4 5
5 1
2 5

2
4

1537

data structure