UVA561 Jackpot

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=7&page=show_problem&problem=502 [PDF](https://uva.onlinejudge.org/external/5/p561.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA561/f7f5401ad97c6095a62f65d5d8f52a9810fbf236.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA561/50fe3d5b3db5d9e092b3274d49f9b83d454d0260.png)