#t526. 打击犯罪
打击犯罪
Criminal Gangs
Special for beginners, ^_^
Problem Description
A region has criminal gangs (). The local police number them in decreasing order of dangerousness. Some gangs are directly connected, but any two gangs can be connected directly or indirectly, so they form one huge criminal syndicate. The dangerousness of a syndicate is determined solely by the number of gangs inside it, regardless of the dangerousness of any individual gang (so this syndicate's dangerousness is ).
Now the police want to spend as little time as possible (that is, crack down on as few gangs as possible) so that the huge syndicate breaks into several smaller syndicates, and the dangerousness of the largest of them does not exceed . For the best effect they will crack down on the gangs numbered through in order. Write a program to find the minimum value of .
Input Format
The first line is a positive integer . The next lines each contain several positive integers; the first integer states how many integers follow it on that line. If a positive integer appears on line , it means gangs and are directly connected.
Output Format
A positive integer: the minimum value of .
Sample Input 1
7
2 2 5
3 1 3 4
2 2 4
2 2 3
3 1 6 7
2 5 7
2 5 6
Sample Output 1
1
Hint
Output 1 (crack down on the criminal gangs).

Constraints
1s, 1024KiB for each test case.