UVA12418 Game of 999

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=279&page=show_problem&problem=3849 [PDF](https://uva.onlinejudge.org/external/124/p12418.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12418/c7e3df1a5712f4360406978cd36e45508c5bfee9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12418/77e9cd4f229c2b80af57068a787a7cef1ee54221.png)

Output Format

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