University of Toronto ACM-ICPC Tryouts 2013
Dr. Baws has an interesting problem. His
The desks are up against the wall, in a single line, so it's possible
that Dr. Baws will have to leave some desks empty. He does know which
students are friends, and fortunately the list is not so long: it turns
out that for any subset of
Input Specification
The input begins with an integer
The total size of the input file does not exceed 2 MB.
Output Specification
For each test case output a single number: the minimum number of desks Dr. Baws requires to seat the students.
Sample Input
1
6 5
1 2
1 3
1 4
4 5
4 6
Sample Output
7
Explanation of Sample
As seen in the diagram, you seat the students in two groups of three with one empty desk in the middle.
Comments