Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Bridges
Description Once upon a time there was a country in a delta of a far-away river. The country had When The king asked you — his major advisor — to develop a bridge building plan. You have to choose Input The first line of the input file contains four integer numbers: s — the number of towns in the country, the number of bridges to build (1 ≤ _{c}k < n ≤ s, _{h}s ≤ _{c}Each of the following e — the towns connected by the road, and _{i}l — the road length in meters (1 ≤ _{i}l ≤ 10_{i}^{6}). Towns are numbered from 1 to n, roads are numbered from 1 to n − 1.Output Output Sample Input 6 2 1 2 1 2 5 3 2 6 1 4 4 4 6 4 4 5 5 Sample Output 1 3 Hint Source Northeastern Europe 2006, Northern Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator