UVA10578 The Game of 31

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=17&page=show_problem&problem=1519 [PDF](https://uva.onlinejudge.org/external/105/p10578.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10578/bf2209e44a906bf0140fa850a415e0026c5f15c2.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10578/8f243a889f33ffb96fedb49ef754be14a0ffd46b.png)

Output Format

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