UVA12848 In Puzzleland (IV)

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4713 [PDF](https://uva.onlinejudge.org/external/128/p12848.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12848/0c07d2db2e03c6859ae5af9880298b7f79c3107f.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12848/8ed93503c327da4bc178a42a7e03c029744ce141.png)