UVa 10369 - Arctic Network

Problem Number - Problem Name
http://uva.onlinejudge.org/external/103/10369.html

Summary
You have a set of outposts, and you want to communicate all. You have 2 choices 1.- Via satellites 2.- Via transceivers And only you have S satelllites chanels available

Given a set of terminals and number of satellites, you want to know the minimun range of the transceivers so that all stations are connected You assume the transceivers at the outposts must be identical

Gotchas
How many connections vis transceivers do you have?

Implementations
You can use Kruskal algorithm, Minimum Spanning Forest You have S satellites connection, and V stations, first you calculate the distance between all outposts, then you know you have V-S connections via transceivers. Whit kruskal algorithm you choose the minimum edges, so you only need to choice the maximum edge which belongs to the minimum spanning forest

Or Binary Search

Input
2 2 4 0 100 0 300 0 600 150 750 3 6 0 1 0 2 0 4 0 5 0 7 0 8

Output
212.13 1.00