UVA10684 The jackpot

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=18&page=show_problem&problem=1625 [PDF](https://uva.onlinejudge.org/external/106/p10684.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10684/da5ce27da25ee3d9d7de0a17e77fcdad84010422.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10684/18ac94d9d20c761798a19492e7756687712b07a4.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10684/4738742288262331bcc5df99bd41d6e784b4ca7e.png)