UVA10974 The Ridiculous Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1915 [PDF](https://uva.onlinejudge.org/external/109/p10974.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10974/ccbd3af2f2b64fc21b901ae31003ea4ce0acb675.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10974/4d80974f774ddfdc5e76d906f58461a49c873efd.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10974/3ac4984f16c8af861efe9498f56c7cd1fcb97031.png)