UVA10073 Constrained Exchange Sort

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1014 [PDF](https://uva.onlinejudge.org/external/100/p10073.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10073/7a2a9aa07cd3b5ffb7e99c4ae887a50259e7cb1d.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10073/13329da20861c041d0d11fce0aa093ca5199906a.png)