Question
Indian Currency Change
You are given an amount (in Indian currency) and an infinite supply of the following denominations:
Coins:
-
₹1, ₹2, ₹5, ₹10
Notes:
-
₹20, ₹50, ₹100, ₹200, ₹500, ₹2000
Your task is to determine the minimum number of coins and/or notes required to make up the exact amount.
Input
The first and only line contains a single integer amount:
An integer representing the total value for which change is to be made using the available denominations.
An integer representing the total value for which change is to be made using the available denominations.
Output
Return an integer representing the minimum number of coins and notes required to make up the given amount.
Example
Input
43
Output
4
Explanation
You can make 43 using denominations: 20 + 20 + 2 + 1
Total coins and notes used = 4
Input
3
Output
2
Explanation
You can make 3 using denominations: 2 + 1
Total coins used = 2
43
Output
4
Explanation
You can make 43 using denominations: 20 + 20 + 2 + 1
Total coins and notes used = 4
Input
3
Output
2
Explanation
You can make 3 using denominations: 2 + 1
Total coins used = 2