AT_past202306_i 最大公約数の最大値
Description
You are given $ N $ integers $ A_1, A_2, \ldots, A_N $ .
Consider choosing $ K $ of them. Find the maximum possible greatest common divisor of the chosen integers.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ K $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $
Output Format
Print the maximum possible greatest common divisor.
Explanation/Hint
### Sample Explanation 1
If you choose $ 2 $ and $ 4 $ , the greatest common divisor will be $ 2 $ , which is the maximum.
### Constraints
- $ 1 \leq K \leq N \leq 5 \times 10^5 $
- $ 1 \leq A_i \leq 10^6 $
- All input values are integers.