UVA10835 Playing with Coins

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=20&page=show_problem&problem=1776 [PDF](https://uva.onlinejudge.org/external/108/p10835.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10835/e2ca9c183316e3d269730e81c8fefd13493222c9.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA10835/5258033c5734406599293c0d3770cfed283dfa02.png)

Output Format

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