100 atcoder#ABC182B. [ABC182B] Almost GCD

[ABC182B] Almost GCD

Score : 200200 points

Problem Statement

Given is an integer sequence AA: A1,A2,A3,,ANA_1, A_2, A_3, \dots, A_N. Let the GCD-ness of a positive integer kk be the number of elements among A1,A2,A3,,ANA_1, A_2, A_3, \dots, A_N that are divisible by kk. Among the integers greater than or equal to 22, find the integer with the greatest GCD-ness. If there are multiple such integers, you may print any of them.

Constraints

  • 1N1001 \le N \le 100
  • 2Ai10002 \le A_i \le 1000
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN

$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 22. If there are multiple such integers, any of them will be accepted.

3
3 12 7
3

Among 33, 1212, and 77, two of them - 33 and 1212 - are divisible by 33, so the GCD-ness of 33 is 22. No integer greater than or equal to 22 has greater GCD-ness, so 33 is a correct answer.

5
8 9 18 90 72
9

In this case, the GCD-ness of 99 is 44. 22 and 33 also have the GCD-ness of 44, so you may also print 22 or 33.

5
1000 1000 1000 1000 1000
1000