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: Ferry Lanes
Description Arthur lives in a small city which is partitioned into two districts, the northern and the southern, by a river flowing through. The northern and southern districts are connected by Today Arthur needs to deliver a package from one dock to another. He knows the sailing time of each ferry lane and the time cost by walking from one dock to an adjacent one along the river bank. Arthur wants to know what is the minimum time his delivery will cost. Input The input consists of several test cases. The first line of each consists an integer Output For each test cases output one line contains the minimum time. You may assume the answer fits in a signed 64-bit integer. Sample Input 4 0 0 1 4 1 3 5 7 3 5 1 3 7 1 3 7 5 0 Sample Output 17 Source POJ Monthly--2007.09.09, Dagger |

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

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

Any problem, Please Contact Administrator