Today’s supermarkets and hypermarkets to avoid the queue of customers for paying their products that they have bought they put some computers where customer can pay himself.
The customer scans all products on machine and the computer shows total amount that customer has to pay. After the customer inserts money the computer has to check if given amount of money is enough for payment or not.
Write a program that does the described job.
Sample Input II Explanation:
Total amount of products is 29+16+75+15=135;
Amount of money given by user is =500, so the difference is 500-135=365, because the difference is greater than zero machine has to calculate the number of coins .
Number of:
- 100 lek coins: difference /100 =>365/100=> 3 coins
- 50 lek coins: Subtract “100 lek” coins from the difference.
difference= difference-(3*100)=365-300=65,
difference/50=> 65/50=> 1 coins.
- 20 lek coins: Subtract “50 lek” coins from the difference.
difference= difference-(1*50)=65-50=15,
difference/20=> 15/20=> 0 coins.
- 10 lek coins: Subtract “20 lek” coins from the difference.
difference= difference-(0*20)=15-0=15,
difference/10=> 15/10=> 1 coins.
- 5 lek coins: Subtract “10 lek” coins from the difference.
difference= difference-(1*10)=15-10=5,
difference/5=> 5/5=> 1 coins.
- 2 lek coins: Subtract “5 lek” coins from the difference.
difference= difference-(1*5)=5-5=0,
difference/1=> 0/1=> 0 coins.
- 1 lek coins: Subtract “2 lek” coins from the difference.
difference= difference-(0*2)=0-0=0,
difference/1=> 0/1=> 0 coins.
So the output is: 3 1 0 1 1 0 0.