UVA10423 Peter Takes a Tramway

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=16&page=show_problem&problem=1364 [PDF](https://uva.onlinejudge.org/external/104/p10423.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10423/92d834f4c1023876aab4836b449ed1a5a9b3d665.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10423/8822c7662e36c65529e579f7222e10567be8d6a1.png)

Output Format

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