Kamar-taj is a place where "The Acient One" trains people to protect earth from other dimensions.
The earth is protected by 'n' sanctums, destroying any of it will lead to invasion on earth.
The sanctums are connected by 'm' bridges.
Now , you being on dormammu's side , want to finds no of sanctum destroying which will disconnect the sanctums.
First line of the input contains T the number of test cases.
First line of each test case contains n(no of sanctums) and m(no of bridges).
Each m line of test case contains p and q denoting sanctum p is connected to sanctum q.
Each new line of the output contains no of sanctums when destroyed will disconnect other sanctums of Earth .
1 ≤ T ≤ 100
1 ≤ n ≤ 30000
1 ≤ m ≤ 30000
1 ≤ p,q ≤ n
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.