UVA11130 Billiard bounces

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=23&page=show_problem&problem=2071 [PDF](https://uva.onlinejudge.org/external/111/p11130.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11130/0455f94b27de4fd24e14c238cfb13908ff51bb65.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11130/5a733bf2823fffa3b8c08978c73afd7d31e98767.png)

Output Format

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