Bridge
BOI 2000 Day 2 Problem 1BridgeNaum has returned to his village Elshani from abroad, where he has earned a lot of money. Everyday the people from Elshani go to work in one of the two neighboring villages Peshtani and Lagadin. There were a lot of paths in the mountain to their destinations. In order to help his neighbors and shorten their traveling Naum wants to build one bridge up to certain length Lmax. TaskFind where to build a bridge that satisfies the following criteria:
Limitations
InputIn the first line of the input file there are two integer numbers N and M and one real number Lmax. In each of the next N lines there are two numbers xi and yi. In each of the next M lines there are two integer numbers representing the points connected by a path.OutputIf there is a solution, the output consists of two integers K1 and K2 representing the points where the bridge should be built.If no bridge can be built with the proposed criteria then write 0 0 in the first line, and write two real numbers d1 and d2 in the second line as reals with no decimal places. d1 is the shortest distance from point 1 to 2 and d2 is the shortest distance from point 1 to 3. Sample Input6 5 40 0 0 100 0 100 100 45 20 55 20 25 50 1 4 4 6 5 2 5 3 6 3 Sample Output4 5 Figure![]() |