UVA12208 How Many Ones Needed?

Description

[problemUrl]: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=244&page=show_problem&problem=3360 [PDF](https://uva.onlinejudge.org/external/122/p12208.pdf) ![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12208/2ef487ee75928a6fe8ff2d73322614f56a21c554.png)

Input Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12208/9a1a2109ee143f2a4699be9dab93670fb3eb5985.png)

Output Format

![](https://cdn.luogu.com.cn/upload/vjudge_pic/UVA12208/0b9a160a176e326ea39c7753c5aa86c300b39b6a.png)