Problem C
Cross Country
Charles Johnson is on his way to meet his very good friend Bernard Terrell. They are going on their bi-weekly skiing trip. Today Charles had forgot all about the Kvikk Lunsj and had to go back home to get it. This has left him very late, and to make things worse all the parking spots close to the meeting spot has been taken. Given the workout diary of Charles, could you help find the fastest path to the meeting spot?
Input
The first line of the input consists of three
space-separated integers
Then follows
Output
The output should be a single line consisting of the minimum number of minutes Charles will have to use to get to the meeting point to share some Kvikk Lunsj with Bernard.
Limits
-
-
-
for -
Sample Input 1 | Sample Output 1 |
---|---|
4 1 3 0 1 3 14 2 0 4 22 3 10 0 7 13 8 2 0 |
11 |