Time limit: 0.05s
Memory limit: 256MB
Input:
Output:
Task
Write a program which, given two integers and such that , finds an integer with 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 and , which define the range of integers.
Output data
Output a single integer — any number with the maximum number of positive divisors in the range .
Constraints and clarifications
- It may be helpful to use the non-standard data type
__int128for 128-bit numbers. You can do all standard mathematical operations and operators that you use with typelong long int. Only you cannot input and output numbers of that type so that’s why you can download a sample programdivs.cppfrom the attachments in which__int128numbers can be directly inputted and outputted. - In tests worth 20 points: .
- In tests worth 50 points: .
- In tests worth 60 points: .
- In tests worth 70 points: .
- In tests worth 80 points: .
- In tests worth 95 points: .
- In tests worth 100 points: .
Example 1
stdin
5 10
stdout
6
Explanation
Integer has four positive divisors. There are no integers in range with more positive divisors. There is one more integer with four positive divisors — .
Example 2
stdin
20 71
stdout
60
Explanation
Integer has positive divisors. All other integers in the range have less positive divisors.