UVA12522 The Imperial Problem

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=441&page=show_problem&problem=3967 [PDF](https://uva.onlinejudge.org/external/125/p12522.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12522/19c23239af08f27783bab44d29073b9155275bfb.png)

Input Format

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

Output Format

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