Contest Duration: - (local time) (120 minutes) Back to Home
C - Max GCD 2 /

Time Limit: 2 sec / Memory Limit: 1024 MB

### 問題文

なお、\gcd(x, y)xy の最大公約数を表します。

### 制約

• A, B は整数
• 1 ≤ A < B ≤ 2 \times 10^5

### 入力

A B


### 入力例 1

2 4


### 出力例 1

2


A ≤ x < y ≤ B を満たす (x,y) の選び方は (2,3), (2,4), (3,4)3 つです。それぞれ最大公約数は 1, 2, 1 であるので、最大値は 2 です。

### 入力例 2

199999 200000


### 出力例 2

1


\gcd(199999, 200000) = 1 です。

### 入力例 3

101 139


### 出力例 3

34


Score : 300 points

### Problem Statement

Given are integers A and B. Find the maximum possible value of \gcd(x, y) when we choose integers x and y so that A ≤ x < y ≤ B.
Here, \gcd(x, y) denotes the greatest common divisor of x and y.

### Constraints

• A and B are integers.
• 1 ≤ A < B ≤ 2 \times 10^5

### Input

Input is given from Standard Input in the following format:

A B


### Sample Input 1

2 4


### Sample Output 1

2


We have three ways to choose (x, y) such that A ≤ x < y ≤ B: (2,3), (2,4), (3,4), where the greatest common divisors are 1, 2, 1, respectively, so the maximum possible value is 2.

### Sample Input 2

199999 200000


### Sample Output 2

1


We have \gcd(199999, 200000) = 1.

### Sample Input 3

101 139


### Sample Output 3

34