UVA12744 Just Some Permutations - 2

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=823&page=show_problem&problem=4597 [PDF](https://uva.onlinejudge.org/external/127/p12744.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12744/8ca3cd0ab0e6413ebce8af6cecdf5f3bdfcebb44.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12744/18305de7754325afa8343f5826185d0d98aa05b8.png)