Problems
You are hosting visitors from out of town, and want to take them out and show them the most interesting places in town.
There are
You know how much it would cost for the group to use each transportation method one time (you pay once per use). You can decide the starting and ending sights of the tour (they can be the same or different sights). You do not need to worry about the cost of getting to the starting point nor coming back from the ending point, only the cost of transportation between sights during the tour. What is the cheapest way to see all sights at least once each?
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
3
6
1 3 10
4 5 10
3 4 10
4 6 20
2 3 30
6
1 3 35
4 5 10
3 4 10
4 6 20
2 3 30
5
1 3 1000000000
2 3 1000000000
3 4 1000000000
3 5 1000000000
Case #1: 100
Case #2: 145
Case #3: 6000000000