#P8219. [WFOI - 02] I wanna a feasitor(化验器)

[WFOI - 02] I wanna a feasitor(化验器)

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 ...

Problem Description

kid found a function f(x)f(x). It represents the largest divisor of xx other than xx itself (xx is an integer greater than 11).

Here are some examples:

  • f(8)=4f(8)=4, because the divisors of 88 are 1,2,4,81,2,4,8. Other than 88 itself, the largest divisor is clearly 44, so f(8)=4f(8)=4.
  • f(15)=5f(15)=5, because the divisors of 1515 are 1,3,5,151,3,5,15. Other than 1515 itself, the largest divisor is clearly 55, so f(15)=5f(15)=5.

kid also found two numbers L,RL,R. You need to help him find the maximum value of f(x)f(x) for every number xx in LRL\sim R, as the password to pass the level.

Note that LRL\sim R includes both LL and RR.

You only need to tell him the answer, and leave the rest to Elgo87!

Input Format

One line with two integers L,RL,R, as described in the statement.

Output Format

One line, indicating the maximum value of f(x)f(x) for each number xx in LRL\sim R.

12 17
8

Hint

[Sample Explanation]

In 121712\sim17, that is, the numbers 12,13,14,15,16,1712,13,14,15,16,17, the largest factors other than the numbers themselves are 6,1,7,5,8,16,1,7,5,8,1, so the maximum value is 88.

[Constraints]

This problem uses Subtask\tt Subtask bundled tests. That is, you must pass all test points in a Subtask\tt Subtask to get the score for that part.

  • Subtask #0 (10pts)\texttt{Subtask \#0 (10pts)}: 2L<R1002\le L< R\le 100.
  • Subtask #1 (30pts)\texttt{Subtask \#1 (30pts)}: 2L<R1042\le L< R\le10^4.
  • Subtask #2 (30pts)\texttt{Subtask \#2 (30pts)}: 2L<R1092\le L < R\le 10^9, RL106R-L\le 10^6.
  • Subtask #3 (30pts)\texttt{Subtask \#3 (30pts)}: 2L<R10182\le L < R \le 10^{18}.

Translated by ChatGPT 5