UVA941 Permutations

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=11&page=show_problem&problem=882 [PDF](https://uva.onlinejudge.org/external/9/p941.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA941/f7ded4bf689f59e9b4827ec1b43569c3d8164836.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA941/4cdc09a43bc36514ab4d6d938969a6a5a76ba867.png)