Logo
(追記) (追記ここまで)

26934번 - The Bus Card 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB88635079.365%

문제

You are going to purchase a bus card. It's a refillable card that cash can be deposited into, and then used to ride the bus until you are out of money. You know that you're planning to travel for $K$ Swedish crowns (SEK). Charging the card takes some time since you can only charge it with 100ドル,ドル 200ドル$ or 500ドル$ SEK at a time.

At the moment you are in a hurry, so you want to make as few transactions as possible, but never insert more money than necessary. If you are to travel for 800ドル$ SEK, this means you should load it with 500ドル,ドル then 200ドル,ドル and then 100ドル$ SEK. On the other hand, if you are traveling for 850ドル$ SEK you should load it first with 500ドル,ドル and then 200ドル$ SEK twice. 50ドル$ SEK will be wasted, but it's still the best alternative.

Compute the minimum number of transactions necessary.

입력

The input consists of the integer $K$ (1ドル \le K \le 10,000円$), the amount you will travel for.

출력

Output a single integer -- the number of transactions necessary.

제한

예제 입력 1

850

예제 출력 1

3

예제 입력 2

1800

예제 출력 2

5

힌트

출처

Olympiad > Swedish Olympiad in Informatics > 2010 > Qualification A번

  • 문제를 만든 사람: Programmeringsolympiaden
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /