UVA12792 Shuffled Deck

Description

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

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12792/955949d0cd1b709e4f8bc5ab226f15e5731801a9.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12792/151b1d96b6853ad552b713688e13f697e6a57498.png)