#arc137a. [arc137_a]Coprime Pair
[arc137_a]Coprime Pair
Problem Statement
You are given integers ().
Snuke is looking for a pair of integers that satisfy both of the conditions below.
Find the maximum possible value of in a pair that satisfies the conditions. It can be proved that at least one such pair exists under the Constraints.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 4
Sample Output 1
1
For , we have , which violates the condition. For , the conditions are satisfied. Here, the value of is . There is no such pair with a greater value of , so the answer is .
Sample Input 2
14 21
Sample Output 2
5
Sample Input 3
1 100
Sample Output 3
99