SP10443 BRDGS - Bridges
Description
A new planet full of rivers was discovered and is being prepared for colonization. We want to connect every piece of land by bridges, the cost of building a bridge is its width.
Input Format
The first number in the input file is T < 200, the number of test cases. Each test case starts with a line with a integer, N
Output Format
For each test case print a single line with "Case #X: C" where X is the number of the test case (starting from 1) and C is the minimum cost to build the bridges so the islands and continents are connected directly or indirectly to each other.