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

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


50278 - ATM

Гость
• Обсуждение задачи (1)

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

• 50260 - What about judges?
• 50259 - Many-coloured roads
• 50276 - Nice Floor
• 50270 - Bitsorting
• 50272 - Strange Numbers
• 50275 - Wedding
• 50273 - Two Captains
• 50274 - Boundary Troops
• 50278 - ATM
• 50277 - Unusual Lottery
• 50283 - Tetris 3D
• 50285 - Meat store
• 50279 - Bit Decoder
• 50284 - Knights of the Rook
• 50282 - Coins
• 50281 - Primes
• 50287 - Providers

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

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

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Автор: Фёдор Меньшиков, ВГПУ.

ATM may contain notes of four kinds: 50, 100, 500 and 1000 rubles. Amount of notes of each kind at any moment is a non-negative integer number. 0 means that there are no notes of this kind. The lack of some notes may be filled with notes of smaller cost. E.g., if the client requested 500 rubles, but ATM has only four 100-ruble notes and two 50-ruble notes, the client will still get his cash.

Suppose that you requested a sum of cash, that is a positive integer number and divides by 50. ATM denied this request, since there is no way it could be done with notes available right now. Find the smallest sum greater than the requested one, such that ATM theoretically could give out.

Input
The first line of input contains a single positive number that divides by 50 and is less or equal to 3000. It's the sum that the ATM could not give out.
Output
Output the single number - the smallest sum greater than the requested one. If there is no such sum, output 0.

Input 1 Output 1
150
200

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

www.contester.ru