UVA12959 Strategy Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4838 [PDF](https://uva.onlinejudge.org/external/129/p12959.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12959/a7cb5b341709ccb41a4791db060ca2e37676a83b.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12959/64fa14124b3a78b707d39a6da57158cc225c1fc9.png)