ACM Vs Non-ACM
Due to some recent unfortunate events, BIT Mesra has become a battle ground for some fierce and deathly fighting between the ACM members and Non-ACM members. The Vice Chancellor wants to know who will survive finally. But he is too afraid to go to the fighting arena.
So, he made a plan. He collected the information from the DC main chat of the college. He found the information about all the dual fights. Dual fight means a fight between a ACM member and a Non-ACM member. He knows the name of the dual fighters, but doesn't know which one of them is an ACM member or not a member. He also read it on the chat that the number of ACM members is definitely less than the number of Non-ACM Members.
So, the VC listed all the rivals. He now wants you to find out the maximum possible number of Non-ACM members.
Input starts with an integer T (<= 20), denoting the number of test cases.
Each case contains an integer n (1 <= n <= 105), denoting the number of dual fights. Each of the next n lines will contain two different integers u v (1 <= u, v <= 20000) denoting there was a fight between u and v. No rivalry will be reported more than once.
For each case print the maximum possible number of Non-ACM members.
Problem Setter: Md Taha Bin Jawaid (TBJ)