ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Unsorted > задача:


51105 - Currency System

Гость
• Вопросы к жюри (1)

Задачи раздела

• 51104 - Steel
• 51113 - The Menu
• 50882 - Say Hello
• 50951 - Odd Numbers
• 50883 - Win or Lose
• 51112 - Even Numbers
• 50892 - Even Numbers
• 51105 - Currency System
• 50891 - Smallest Number
• 50965 - Draw the Pattern
• 51103 - Is it a triangle?
• 50945 - Bigger or Smaller
• 50946 - Area of Rectangle
• 50949 - Vowel or Consonant
• 50881 - Exchange the Values
• 51114 - The traveling vehicle

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.

Currency System

Question: Consider a Currency System in which there are notes of six denominations, namely, 1 cs, 2 cs, 5 cs, 10 cs, 50 cs, 100 cs. Write a program to compute smallest number of notes, if the sum of cs (N) is entered.

Input specification: The first number contains an integer T which is the total number of test cases followed by T numbers, each number containing an integer N separated by space.

Output specification: Display the smallest number of notes that will combine to give N.

Sample Input Sample Output
3 1200 550 242
2 2150 1450
12 6 7
22 15

Explanation: In the first sample input, 3 is the total number of test cases. 1200 is the first test case of the line. In order for the total notes the smallest, we start choosing the higher denomination which is 100 cs. Therefore, we can make 12 notes out of 1200 cs. The next number (550) can be chosen like: 5 from 100cs (500 cs) and 1 from 50cs (50 cs) whose total is 550 cs.



Для отправки решений необходимо выполнить вход.

www.contester.ru