UVA12751 An Interesting Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4604 [PDF](https://uva.onlinejudge.org/external/127/p12751.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12751/bf99dad3d55be809842cbc6003a4d42d7c3b5a28.png)

Input Format

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

Output Format

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