UVA10707 2D-Nim

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=19&page=show_problem&problem=1648 [PDF](https://uva.onlinejudge.org/external/107/p10707.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10707/c01d82eeb9f695352353b32101ef15571639d551.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10707/2156dd5493dbad910c7614a5314f545cae3bdceb.png)

Output Format

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