P13747 [CodeChef] cc
NOI
题目描述

Given a undirected graph find the number of connected components.

Input
First line of the input is 't'- number of test case. Followed by N, the number of vertices (Numbered 0 to N-1). Followed by 'e' number of edges. Followed by description of 'e' edges in the form 'a b' I.e. an edge exist between vertex a and b.
Constraints:
T=10
2 ≤ N ≤ 100000
0 ≤ e ≤ N/2

Output
One line per test case, number of connected components in the graph.

Example

Input:
2
4
2
0 1
0 2
8
0

Output:
2
8

输入格式

见题面

输出格式

见题面

样例输入
2 4 2 0 1 0 2 8 0
样例输出
2 8