UVA11353 A Different Kind of Sorting

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=25&page=show_problem&problem=2338 [PDF](https://uva.onlinejudge.org/external/113/p11353.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11353/1c6b7410b9f1b01e097dd276c7e1da60fa3156eb.png)

Input Format

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

Output Format

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