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

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


51105 - Currency System

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

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

• 50881 - Exchange the Values
• 50937 - Calculate the Average
• 50947 - Calculate the Average
• 50964 - Increasing or Decreasing
• 50948 - Translate Score into Grade
• 51104 - Steel
• 51113 - The Menu
• 51112 - Even Numbers
• 51105 - Currency System
• 51103 - Is it a triangle?
• 51114 - The traveling vehicle
• 50251 - Symmetric matrix
• 50252 - Birthday
• 50239 - Eating cheese
• 50244 - Chessboard Pattern
• 50245 - Santa Gifts
• 50256 - Sequence

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

Если у вас есть предложения или пожелания по работе 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