Counting Coins – Create a function to calculate the sum of coins, read Input from STDIN and print output to STDOUT
Counting Coins
Problem Statement:
Create a function which can calculate the sum of the total amount of coins, the function should accept four arguments which denotes the number of two rupee coins, five rupee coins, ten rupee coins and hundred rupees as input and return the total values of the each coin and find total amount.
Sample Case 0
Sample Input
1 1 1 1
Sample Output
2 5 10 100 117
Explanation
In this case, we have one 2 rupee coin, one 5 rupee coin, one 10 rupee coin and one 100 rupee coin, so the total amount of coins will be
1 x 2 = 2 1 x 5 = 5 1 x 10 = 10 1 x 100 = 100
and their total sum will be 2 + 5 + 10 + 100 = 117
Sample Case 1
Sample Input
5 10 1 1
Sample Output
10 50 10 100 170
Explanation
In this case, we have five 2 rupee coin, ten 5 rupee coin, one 10 rupee coin and one 100 rupee coin, so the total amount of coins will be
5 x 2 = 10 10 x 5 = 50 1 x 10 = 10 1 x 100 = 100
and their total sum will be 10 + 50 + 10 + 100 = 170
Solution:
Output:
$python counting_coins.py 1 1 1 1 2 5 10 100 117