1078:Delete

时间限制: 5 S | 内存限制: 65536 KB
Accept: 0 | Submit: 0
[提交] [状态] [讨论版]
描述

Kim have an undirected complete graph with n vertices drawn on a paper. A complete graph is a simple undirected graph in which every pair of distinct vertices is connected by a unique edge. One day he his naughty little brother came again and erased some vertices and edges.
Kim wants to know how many connected components are there now.
In graph theory, a connected component of an undirected graph is a subgraph in which any two vertices are connected to each other by paths, and which is connected to no additional vertices in the supergraph.

输入


输出

For each case, print a line contains the answer.

样例输入

2
4 2 1
2 4
3 4
1
10 10 3
5 6
5 7
5 8
5 9
5 10
4 6
4 7
4 8
4 9
4 10
1 2 3

样例输出

2
2

HINT

The original graph in simple input 1 look like this:

and after delete:

so there are 2 connected components.

来源
2017年第八届福建省大学生程序设计竞赛热身赛