UVA11707 Pachinko

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2754 [PDF](https://uva.onlinejudge.org/external/117/p11707.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11707/9e15a097f23b36de4c744cd80409eff81e697dae.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11707/63e88ad1834433049380db8944098cd4fee470be.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11707/6f08cd04d57b275d025e54eca71253ed97bf50ff.png)