|| ||Code Submission Evaluation System
CSES Problem Set
Task | Statistics
CSES - Common DivisorsCSES - Common Divisors
|Time limit:||1.00 s
||Memory limit:||512 MB|
You are given an array that has $n$ positive integers. Your task is to find two integers such that their greatest common divisor is as large as possible.
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.
Print the maximum greatest common divisor.
- $1 \le n \le 5 \cdot 10^5$
- $1 \le x_i \le 10^6$
3 14 15 7 9