#abc296d. [abc296_d]M<=ab
[abc296_d]M<=ab
Problem Statement
You are given positive integers and .
Find the smallest positive integer that satisfies both of the conditions below, or print if there is no such integer.
- can be represented as the product of two integers and between and , inclusive. Here, and may be the same.
- is at least .
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the smallest positive integer that satisfies both of the conditions, or if there is no such integer.
Sample Input 1
5 7
Sample Output 1
8
First, cannot be represented as the product of two integers between and .
Second, can be represented as the product of two integers between and , such as .
Thus, you should print .
Sample Input 2
2 5
Sample Output 2
-1
Since , , , and , only , , and can be represented as the product of two integers between and , so no number greater than or equal to can be represented as the product of two such integers.
Thus, you should print .
Sample Input 3
100000 10000000000
Sample Output 3
10000000000
For , the product of and is , which is the answer.
Note that the answer may not fit into a -bit integer type.