UVA12841 In Puzzleland (III)

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12841/4381fba66fd60ee035e3ae1f2e99d38b3f64792d.png)

Output Format

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