UVA12953 Puzzle

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4832 [PDF](https://uva.onlinejudge.org/external/129/p12953.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12953/b1b641231f475350a27c4291e41e403a2d5cfdba.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12953/4585a72508979603d31ee3d4486a49658d7b9a03.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12953/97b28d4f446aee0268311e7255f9b43db95b3b31.png)