HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


ATM

Section problems

• Roads
• Brackets
• Triangles
• String Multiplication
• Nice Floor
• Strange Numbers
• Factorial
• Boundary Troops
• ATM
• Division
• Unusual Lottery
• Meat store
• Tetris 3D
• Bit Decoder
• Knights of the Rook
• Coins
• Primes

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Автор: Фёдор Меньшиков, ВГПУ.

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