Problems
You are in charge of the maintenance of a railroad network. The network consists of
The easiest way to do maintenance is to shut down entire lines, one at a time. However, some train lines may be essential. A train line is essential if removing it would make at least one trip between a pair of stations not possible.
Given the list of existing train lines, calculate how many of them are essential.
Input
The first line of the input gives the number of test cases,
Output
For each test case, output one line containing Case #,
where
Example
4
4 3
3
1 2 3
2
1 4
3
4 1 3
4 4
2
1 2
2
3 4
2
3 2
2
4 1
4 3
2
1 2
2
3 4
2
3 2
4 3
2
1 2
2
3 4
4
4 1 2 3
Case #1: 1
Case #2: 0
Case #3: 3
Case #4: 1