#2718. 区间最大公约数
区间最大公约数
Description
给定两个正整数<math xmlns="http://www.w3.org/1998/Math/MathML">L,R,你可以任意选择两个正整数<math xmlns="http://www.w3.org/1998/Math/MathML">x,y且满足<math xmlns="http://www.w3.org/1998/Math/MathML">L≤x < y≤R,并求出x,y的最大公约数。
请问在所有选法中,x,y最大公约数的最大值为多少?
Input Format
输入共一行,两个正整数表示<math xmlns="http://www.w3.org/1998/Math/MathML">L,ROutput Format
输出共一个整数,表示所求答案23 29
4
Hint
说明:选(24,28)时,取到最大值为 4
输入2:
32678 65536
输出2:
32768
输入3:
32768 32769
输出3:
1
数据范围
- 对于<math xmlns="http://www.w3.org/1998/Math/MathML">30%的数据,1≤L≤R≤100
- 对于<math xmlns="http://www.w3.org/1998/Math/MathML">60%的数据,1≤L≤R≤103
- 对于<math xmlns="http://www.w3.org/1998/Math/MathML">100%的数据,<math xmlns="http://www.w3.org/1998/Math/MathML">1≤L≤R≤5×105