UVA10961 Chasing After Don Giovanni

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1902 [PDF](https://uva.onlinejudge.org/external/109/p10961.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10961/22c1cb3adb58808806b4d771aab45f9571f3b9fa.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10961/0962677c508f3b3e74119259a86d2c5367153fd3.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10961/1660bf89d217ab3f701d7a1ee6a5549d0ce9db7d.png)