UVA10387 Billiard

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=15&page=show_problem&problem=1328 [PDF](https://uva.onlinejudge.org/external/103/p10387.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10387/2235eac19f6bca3999aec37163c3e4e0b95f9322.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10387/07e7eb15ca10314b9695dd61a7ea340c8b57e1df.png)