UVA12633 Super Rooks on Chessboard

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=602&page=show_problem&problem=4358 [PDF](https://uva.onlinejudge.org/external/126/p12633.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12633/f4ede15c949558e8f537a9f410a7acc1e275e5d5.png)

Input Format

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

Output Format

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