COMPUTER NETWORK
To prepare for the second round of the regional informatics olympiad, all computers need to be connected into a single network. Currently, there are separate connections between some computers, forming distinct local networks.
All computers are considered part of a single network if there is a path connecting any pair of computers.
The input provides the costs of connecting the i-th computer to the j-th computer (costs can be integers or decimals). It also lists which computers are already connected.
Your task is to determine the minimum cost required to connect all computers into one network. If it's impossible, output "No".
Input
The first line contains three numbers: N - the number of computers (2 ≤ N ≤ 1000), M - the number of pairs of computers for which connection costs are known (_2 ≤ M ≤ N(N-1)/2_), and K - the number of existing connections between computers (_2 ≤ K ≤ N(N-1)/2_).
The next M lines each contain three numbers: the indices of two computers that can be connected and the cost of this connection. Following that, there are K lines, each with two numbers indicating computers that are already connected.
Output
Output the minimum cost in hryvnias, formatted to two decimal places as XXX.XX UAH (without leading zeros and with exactly two digits after the decimal point). If the cost is 0, output 0.00 UAH. If it's impossible to connect all computers, output "No".