UVA11889 Benefit

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=226&page=show_problem&problem=2989 [PDF](https://uva.onlinejudge.org/external/118/p11889.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11889/1588740ad2fa4cdc66ad2b07066e440857631a2c.png)

Input Format

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

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA11889/3a5d4ba6e6d358c9a17c026a907c021a72350aa8.png)