UVA11630 Cyclic antimonotonic permutations

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=78&page=show_problem&problem=2677 [PDF](https://uva.onlinejudge.org/external/116/p11630.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11630/134f19c7137c330a8bdb33653f15e281cef1dab0.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11630/7eb30a0c484d48f48607cd802c2f8f3e427f5a70.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11630/1db06f1fb34c469c3fa80da5936f193e3b49d154.png)