UVA896 Board Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=10&page=show_problem&problem=837 [PDF](https://uva.onlinejudge.org/external/8/p896.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA896/42a9f48f745e9651a11d2f80dfb7da812179e09f.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA896/4664002a5ad7ea4469d29fea548e431bc7f0b3e5.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA896/99fddda25e2a890195c03174be0815156470b6d6.png)