UVA798 Tile Puzzle

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=9&page=show_problem&problem=739 [PDF](https://uva.onlinejudge.org/external/7/p798.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA798/38a8c1833b2371bfdcecf7dea86bc7163b1d3cc5.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA798/8791444af8903ca91c61786ebb1be9569af9d0ab.png)