UVA535 Globetrotter

Description

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

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA535/47b73ed2cf96a005e5e9393d9623122130af0feb.png)