UVA12009 Avaricious Maryanna

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=242&page=show_problem&problem=3160 [PDF](https://uva.onlinejudge.org/external/120/p12009.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12009/6626736a558249dbee40d806cca32288a8925656.png)

Input Format

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

Output Format

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