
Fax McClad, Croneria's most profitable bounty hunter, has a part-time job delivering microwaves.
Croneria has
However, the Committee for Charging Cronerians (CCC), the organization responsible for setting the tolls on the toll route system, is greedy. At times, they might decide to add an integer amount to the cost of every single toll route. In order to trick Cronerians into thinking they are fair, the CCC might add a negative amount to the costs.
For each day, can you tell Fax the minimum amount of moneys he will need to spend to deliver the microwaves?
Input Specification
The first line of input will contain 3 space-separated integers,
For 1 of the 15 points, each city has at most 1 out-going toll route and
For an additional 2 of the 15 points,
For an additional 2 of the 15 points,
For an additional 2 of the 15 points,
Output Specification
For each day, print the minimum amount of moneys Fax needs to spend to reach his destination. If no path exists, print Cannot Deliver
.
Sample Input
5 6 3
1 2 2
2 5 4
1 5 10
1 3 2
3 4 3
4 5 4
0 5
10 5
-20 5
Sample Output
6
20
-21
Explanation for Sample Output
On the first day, no changes were made to the toll routes, so Fax should take the path
On the second day, the cost of each toll route increased by 10, so Fax should take the path
On the third day, the cost of each toll route decreased by 20, so Fax should take the path
Comments