UVA10743 Blocks on Blocks

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10743/42e3e24c462e777cee53d0334419789ac9df760a.png)

Output Format

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