Problem7655--[CSES Problem Set] Common Divisors

7655: [CSES Problem Set] Common Divisors

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

You are given an array of $n$ positive integers. Your task is to find two integers such that their greatest common divisor is as large as possible.

Input

The first input line has an integer $n$: the size of the array.
The second line has $n$ integers $x_1,x_2,\ldots,x_n$: the contents of the array.

Output

Print the maximum greatest common divisor.

Constraints

$2≤n≤2⋅10^5$
$1 \le x_i \le 10^6$

Sample 1 Input

5
3 14 15 7 9

Sample 1 Output

7

HINT

相同题目:CSES 1081

Source/Category