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

Турниры > Epoka Science Olympiad 2017 - 10th Grade > задача:


3. 51105 - Currency System

Epoka Science Olympiad 2017 - 10th Grade

Старт: 06.мая.2017 в 10:00:00
Финиш: 06.мая.2017 в 12:30:00
Турнир завершён!
• Турнирная таблица

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

Задачи турнира

• 1. 51103 - Is it a triangle?
• 2. 51104 - Steel
• 3. 51105 - Currency System
• 4. 51106 - Polar Bear

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

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