P8219 [WFOI - 02] I wanna a feasitor (Analyzer)
Background
> What are you doing during the contest? Are you free? Can you come and start longlong?
kid looks at Elgo87 with a confused face. Elgo87 says he will tell you after you pass the level ...
Description
kid found a function $f(x)$. It represents the **largest divisor of $x$ other than $x$ itself** ($x$ is an integer greater than $1$).
Here are some examples:
- $f(8)=4$, because the divisors of $8$ are $1,2,4,8$. Other than $8$ itself, the largest divisor is clearly $4$, so $f(8)=4$.
- $f(15)=5$, because the divisors of $15$ are $1,3,5,15$. Other than $15$ itself, the largest divisor is clearly $5$, so $f(15)=5$.
kid also found two numbers $L,R$. You need to help him find the **maximum value** of $f(x)$ for every number $x$ in $L\sim R$, as the password to pass the level.
Note that $L\sim R$ includes both $L$ and $R$.
You only need to tell him the answer, and leave the rest to Elgo87!
Input Format
One line with two integers $L,R$, as described in the statement.
Output Format
One line, indicating the maximum value of $f(x)$ for each number $x$ in $L\sim R$.
Explanation/Hint
**[Sample Explanation]**
In $12\sim17$, that is, the numbers $12,13,14,15,16,17$, the largest factors other than the numbers themselves are $6,1,7,5,8,1$, so the maximum value is $8$.
**[Constraints]**
**This problem uses $\tt Subtask$ bundled tests.** That is, you must pass all test points in a $\tt Subtask$ to get the score for that part.
- $\texttt{Subtask \#0 (10pts)}$: $2\le L< R\le 100$.
- $\texttt{Subtask \#1 (30pts)}$: $2\le L< R\le10^4$.
- $\texttt{Subtask \#2 (30pts)}$: $2\le L < R\le 10^9$, $R-L\le 10^6$.
- $\texttt{Subtask \#3 (30pts)}$: $2\le L < R \le 10^{18}$.
Translated by ChatGPT 5