Pendu is event coordinator in Cognizance. He has to distribute posters in bhawans for his event promotion.
IIT Roorkee has N bhawans which are connected by M bidirectional paths such that there exist at most one path between any two bhawans. A student will read the poster if there exists a path from his bhawan to the bhawan where the poster is distributed.
There is a shortage of paper in IIT Roorkee. Help Pendu to find the minimum number of posters required such that all students of IIT Roorkee read the poster.
INPUT FORMAT
First line contains a single integer T denoting the number of test cases.
Each of the next T lines contains N and M.
OUTPUT FORMAT
For each test case, print a single line containing required output.
CONSTRAINTS
1 <= t <= 20
1 <= n,m <= 100