UVA12350 Queen Game

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=278&page=show_problem&problem=3772 [PDF](https://uva.onlinejudge.org/external/123/p12350.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12350/af3e055886b120cf2ae9db68c5c23c87251d519b.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12350/51b15939bda8e421b14aa70f0686f8ca0cbf351a.png)

Output Format

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