26. ATM Note Counter

Acceptance — 0 accepted 0 submissions

Easy
BasicsGreedyMath
No companies listed
An ATM has only 500, 200 and 100 rupee notes. It always gives the fewest notes possible by using the biggest notes first.

Given the amount to withdraw, print how many notes of each type the ATM gives.

Input Format
A single integer A, the amount (always a multiple of 100).

Output Format
Print three lines in this exact format:
500: <count>
200: <count>
100: <count>

Constraints
• 100 ≤ A ≤ 100000
• A is a multiple of 100

Example 1

Input
1800
Output
500: 3
200: 1
100: 1

Explanation 3 × 500 = 1500, then 300 is left: 1 × 200 + 1 × 100.

Example 2

Input
400
Output
500: 0
200: 2
100: 0

Explanation No 500 note fits, so 2 × 200.

Example 3

Input
100
Output
500: 0
200: 0
100: 1

Explanation Just one 100 rupee note.

Acceptance —
Accepted 0
Submissions 0
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
500: 3 200: 1 100: 1
No results yet
Run your code to test it against the sample cases.
Problem List