first of all, I am very bad at numbers. here is the calculation. it looks simple to me but I struggle more to solve this.

I am a stamp vendor so I do sale stamps according to my government provided denomination with certain rules.

stamp paper available denominations are 10,50,100,500,1000,5000,10000,15000,20000,25000

for example if a person wants 17000 then I have provide 7 or 13 sheets using above denomination if possible.

17000 in 7 sheets

number of possiblities

i)

5000 * 3 = 15000

500 * 4 = 2000

_________________________

7 17000

_________________________

so 7 stamp papers total of 17000 amount

At some situation I don't have 5000 denomination at that moment I have to figure out other possibility

ii)

13 sheet for 30000

10000 * 1 = 10000

5000 * 2 = 10000

1000 * 10 = 10000

___________________________

13 30000

so 13 stamp papers total of 30000 amount

This above two example took me 15 mins to figure out.

Is there any formula or method to figure out the denominations in a quick way?

Thanks