EGOI '21 P1 - Zeros
View as PDFEuropean Girls' Olympiad in Informatics: 2021 Day 1 Problem 1
Santa Claus is already preparing for Christmas 2021. He wants to buy some positive
number of presents, such that he will be able to divide them evenly (without
remainder) among all eligible (not naughty) children. However, he does not yet know
how many eligible children there will be - he only knows that this number will be
between  and 
. Therefore, he wants to buy the minimum positive number of presents
that can be divided evenly between any number 
 of children with 
.
He has computed this (possibly huge) number of presents, but he is unsure about the correctness, and he would like your help in performing the following basic sanity check. Are you able to tell him how many zero digits there should be at the end of this number?
Input Specification
The first and only line of the input consists of two space-separated integers  and 
 
.
Output Specification
Output a single integer — the number of zeros at the end of the number of presents that Santa needs to buy.
Constraints
| Subtask | Points | Constraints | 
|---|---|---|
| No additional constraints. | 
Sample Input 1
1 6
Sample Output 1
1
Explanation for Sample Output 1
If there can be between  and 
 children, then Santa needs at least 
presents (as this is the smallest number that is divisible by all of 
, 
, 
, 
, 
 and 
),
and the number 
 has a single zero at the end.
Sample Input 2
10 11
Sample Output 2
1
Explanation for Sample Output 2
If there can be either  or 
 children, Santa will buy 
 presents.
Comments