UVA664 Single-Player Games

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=8&page=show_problem&problem=605 [PDF](https://uva.onlinejudge.org/external/6/p664.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA664/3b547906c46313383622b01d3c9d0b2f7a16cc8f.png)

Input Format

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

Output Format

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