divs

Time limit: 0.05s Memory limit: 256MB Input: Output:

Task

Write a program which, given two integers AA and BB such that 2AB2 \cdot A \leq B, finds an integer NN with ANBA \leq N \leq B that has the maximum number of positive divisors. If there are multiple such integers, you can find any one of them.

Input data

The input consists of a single line containing two space-separated integers AA and BB, which define the range of integers.

Output data

Output a single integer — any number with the maximum number of positive divisors in the range [A,B][A,B].

Constraints and clarifications

  • 1A<B21201 \leq A < B \leq 2^{120}
  • 2AB2 \cdot A \leq B
  • It may be helpful to use the non-standard data type __int128 for 128-bit numbers. You can do all standard mathematical operations and operators that you use with type long long int. Only you cannot input and output numbers of that type so that’s why you can download a sample program divs.cpp from the attachments in which __int128 numbers can be directly inputted and outputted.
  • In tests worth 20 points: 1A<B2101 \leq A < B \leq 2^{10}.
  • In tests worth 50 points: 1A<B2201 \leq A < B \leq 2^{20}.
  • In tests worth 60 points: 1A<B2301 \leq A < B \leq 2^{30}.
  • In tests worth 70 points: 1A<B2401 \leq A < B \leq 2^{40}.
  • In tests worth 80 points: 1A<B2601 \leq A < B \leq 2^{60}.
  • In tests worth 95 points: 1A<B2801 \leq A < B \leq 2^{80}.
  • In tests worth 100 points: 1A<B21201 \leq A < B \leq 2^{120}.

Example 1

stdin

5 10

stdout

6

Explanation

Integer 66 has four positive divisors. There are no integers in range [5,10][5, 10] with more positive divisors. There is one more integer with four positive divisors — 88.

Example 2

stdin

20 71

stdout

60

Explanation

Integer 6060 has 1212 positive divisors. All other integers in the range [20,71][20, 71] have less positive divisors.

Log in or sign up to be able to send submissions!