UVA10949 Kids in a Grid

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=21&page=show_problem&problem=1890 [PDF](https://uva.onlinejudge.org/external/109/p10949.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10949/02c2806c0ec536b3e448883fb7e652cfbbc4d4a6.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10949/86f5181d944ba3b799a41e35b30a7e529ea1767b.png)

Output Format

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