Problems
Farmer John dutifully checks on the cows every day.
He traverses some of the
The
Each trail
He wants to revamp some of the trails on his farm to save time on his long journey.
Specifically, he will choose
Help FJ decide which trails to revamp to minimize the resulting time of getting from pasture
Input
* Line 1: Three space-separated integers:
* Lines 2..
Output
* Line 1: The length of the shortest path after revamping no more than
Example
4 4 1
1 2 10
2 4 10
1 3 1
3 4 100
1
K is 1; revamp trail 3->4 to take time 0 instead of 100.
The new shortest path is 1->3->4, total traversal time now 1.