
Лимит времени 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 nonnegative 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 100ruble notes and two 50ruble 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.
Для отправки решений необходимо выполнить вход.
