UVA510 Optimal Routing

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=451 [PDF](https://uva.onlinejudge.org/external/5/p510.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA510/ed31a0deb21cad0d075d84f2444e92d3de83986c.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA510/0f647158a715be150b261f3a9b9833386befac6b.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA510/c5c927ac3f40d11da97479a6f3f6ac9a9c1a5214.png)