UVA12855 Black and white stones

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4720 [PDF](https://uva.onlinejudge.org/external/128/p12855.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12855/d9e78acbd8f2d97cb2aecc87d33708a37aa2c6f9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12855/3c6a2fae2b63b6c8cc760a98bf0ed483fb932835.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12855/08fe8477e19544af559d52936e736e88da1fcbb0.png)