Find the denomination

You will be given an integer n that denotes a bill amount that you have to pay with the given coins. You need to provide the most efficient way of paying that amount in coins . That means, use the minimum number of coins possible for this.

Assume that the coins given are of denominations 1, 2, 5 and 10.

Input format : n

Output format : Print the coins required (separated by space)

Sample Input 1 :
7
Sample Output 1 :
5 2
Sample Input 2 :
44
Sample Output 2 :
10 10 10 10 2 2 

Login to submit your solution

Fb dab53a1a64929320dc7425896aa73fd9e5512b6ab52e414ff5f3ebb5cecc73eb

Share Problem