acmsguru |
---|
Finished |
145. Strange People time limit per test: 0.25 sec.
Once upon a time in one kingdom lives strange people. In this kingdom to travel from city to city there was a taxes. But people don't want to travel cheaper from one place to another. They want to travel from place to place by K-th simple expensive path betwen this cites. Your task is to find how much money they must prepare to go from one given city to another (also given) if they travel using K'th simple expensive path between these two cites. And you must print that path. (if there exist many solutions output any of them) It is guarantee that K'th expensive path between this cites exist. If there is road between city X and Y than there is road between Y and X. Between two cites exists no more than 1 road.
Input
Output Z dc
Sample Input 5 10 3 1 2 6 1 3 13 1 4 18 1 5 35 2 3 14 2 4 34 2 5 17 3 4 22 3 5 15 4 5 34 1 5
Sample Output 35 2 1 5 Some explanations to Sample Test case: | ||||||
|
Name |
---|