CF996A.Hit the Lottery

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Allen has a LOT of money. He has nn dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are 11 , 55 , 1010 , 2020 , 100100 . What is the minimum number of bills Allen could receive after withdrawing his entire balance?

输入格式

The first and only line of input contains a single integer nn ( 1n1091 \le n \le 10^9 ).

输出格式

Output the minimum number of bills that Allen could receive.

输入输出样例

  • 输入#1

    125
    

    输出#1

    3
    
  • 输入#2

    43
    

    输出#2

    5
    
  • 输入#3

    1000000000
    

    输出#3

    10000000
    

说明/提示

In the first sample case, Allen can withdraw this with a 100100 dollar bill, a 2020 dollar bill, and a 55 dollar bill. There is no way for Allen to receive 125125 dollars in one or two bills.

In the second sample case, Allen can withdraw two 2020 dollar bills and three 11 dollar bills.

In the third sample case, Allen can withdraw 100000000100000000 (ten million!) 100100 dollar bills.

首页