UVA12918 Lucky Thief

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=862&page=show_problem&problem=4797 [PDF](https://uva.onlinejudge.org/external/129/p12918.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12918/a32fbf26ecad00912cc4d39b2236dfec5995e8e1.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12918/141502240d599f27ca3bcd3b58a4feea336bba69.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12918/589a0bc0471dc6739da3a0c107f67753c5e0bf60.png)