UVA794 Straightest Paths

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=9&page=show_problem&problem=735 [PDF](https://uva.onlinejudge.org/external/7/p794.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA794/12176bb5c4fc1e8284028d9f8ceea581eef36bb2.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA794/735a723144f8edce8dded4979ba58a35959b3887.png)

Output Format

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