UVA12817 Sleight of Hand

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=861&page=show_problem&problem=4682 [PDF](https://uva.onlinejudge.org/external/128/p12817.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12817/754fc93488001c98d987c2eaf63606213844538c.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12817/91fae30700cdd33809786afc4ea8bb808efd041d.png)