UVA114 Simulation Wizardry

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=50 [PDF](https://uva.onlinejudge.org/external/1/p114.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA114/a67b17c6c4f176c28db24463c66f1b5914cdd9e6.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA114/2cfacf5634e408a15f3e4c1995da2b93c1a1a5c0.png)