UVA11708 Lexicographical ranking

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=117&page=show_problem&problem=2755 [PDF](https://uva.onlinejudge.org/external/117/p11708.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11708/e11e1ea5339985a48d72c46277f2b708a1eb9180.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11708/080fab8947c6062fdfa85b5f8ca0b1da5a8828d8.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11708/93095cc5b4f1a1c1612dd84f43857773f355a853.png)