P9309 [EGOI 2021] Number of Zeros / Number of Zeros
Background
Day 1 Problem A.
Translated from [EGOI2021 zeros](https://stats.egoi.org/media/task_description/2021_zeros_en.pdf).
Description
Santa Claus is preparing for Christmas $2021$. He wants to buy a positive integer number of gifts so that they can be evenly distributed among all well-behaved children. However, he does not know the exact number of well-behaved children; he only knows that the number is between $a$ and $b$. He wants to buy the smallest positive integer number of gifts such that it can be evenly divided among any $x \in \{a, a+1, \ldots, b\}$ children.
He has already computed this (possibly very large) number of gifts, but he is not sure whether his computation is correct, so he wants you to do some basic correctness checks. Can you tell him how many trailing zeros the answer has?
Input Format
One line containing two integers $a, b$.
Output Format
One line containing one integer, the number of trailing zeros of the answer.
Explanation/Hint
**Explanation for Sample $1$**
If there may be between $1$ and $6$ well-behaved children, Santa Claus needs at least $60$ gifts (this is the smallest positive integer divisible by $1,2,3,4,5,6$), and $60$ has one trailing zero.
---
**Explanation for Sample $2$**
If there may be $10$ or $11$ well-behaved children, Santa Claus will buy $110$ gifts.
---
**Constraints**
For all testdata, $1 \le a \le b \le 10^{18}$.
- Subtask 1 ($6$ points): $b \le 16$.
- Subtask 2 ($7$ points): $b \le 40$.
- Subtask 3 ($9$ points): $a = 1$, $b \le 200$.
- Subtask 4 ($12$ points): $b-a \le 10^6$.
- Subtask 5 ($17$ points): $a = 1$.
- Subtask 6 ($49$ points): no additional constraints.
Translated by ChatGPT 5