UVA331 Mapping the Swaps

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=5&page=show_problem&problem=267 [PDF](https://uva.onlinejudge.org/external/3/p331.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA331/f04222bfb90e2f9195ef0a9d9b8a95153af27313.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA331/0b43839e4ac85edc2782b694d0d2af1bd2acff25.png)

Output Format

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