#abc182b. [abc182_b]Almost GCD
[abc182_b]Almost GCD
Problem Statement
Given is an integer sequence : .
Let the GCD-ness of a positive integer be the number of elements among that are divisible by .
Among the integers greater than or equal to , find the integer with the greatest GCD-ness. If there are multiple such integers, you may print any of them.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$A_1 \\hspace{7pt} A_2 \\hspace{7pt} A_3 \\hspace{5pt} \\dots \\hspace{5pt} A_N$
Output
Print an integer with the greatest GCD-ness among the integers greater than or equal to . If there are multiple such integers, any of them will be accepted.
Sample Input 1
3
3 12 7
Sample Output 1
3
Among , , and , two of them - and - are divisible by , so the GCD-ness of is .
No integer greater than or equal to has greater GCD-ness, so is a correct answer.
Sample Input 2
5
8 9 18 90 72
Sample Output 2
9
In this case, the GCD-ness of is .
and also have the GCD-ness of , so you may also print or .
Sample Input 3
5
1000 1000 1000 1000 1000
Sample Output 3
1000