URI Online Judge | 1018 Banknotes Solve with source code

URI Online Judge | 1018
Banknotes
Adapted by Neilor Tonin, URI  Brazil

Timelimit: 1
In this problem you have to read an integer value and calculate the smallest possible number of banknotes in which the value may be decomposed. The possible banknotes are 100, 50, 20, 10, 5, 2 e 1. Print the read value and the list of banknotes.

Input
The input file contains an integer value N (0 < N < 1000000).

Output
Print the read number and the minimum quantity of each necessary banknotes in Portuguese language, as the given example. Do not forget to print the end of line after each line, otherwise you will receive “Presentation Error”.


SOLVE

                      num = int(input())
                      print(num)
                      print('%d'%(num/100),'nota(s) de R$ 100,00')
                      num%=100
                      print('%d'%(num/50),'nota(s) de R$ 50,00')
                      num%=50
                      print('%d'%(num/20),'nota(s) de R$ 20,00')
                      num%=20
                      print('%d'%(num/10),'nota(s) de R$ 10,00')
                      num%=10
                      print('%d'%(num/5),'nota(s) de R$ 5,00')
                      num%=5
                      print('%d'%(num/2),'nota(s) de R$ 2,00')
                      num%=2
                      print('%d'%(num/1),'nota(s) de R$ 1,00')





Comments

Popular posts from this blog

How to solve an 8 puzzle problem using A* Algorithm in python

Timus Online Judge 1000. A+B Problem question and SOLVE with sudo code

URI Online Judge | 1013 The Greatest Solve with source code