PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000117. Số chia hết nhiều nhất (Almost GCD)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số chia hết nhiều nhất (Almost GCD)

Almost GCD

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Given nn positive integers a1,a2,…,ana_1,a_2,\ldots,a_n, define the divisibility score of an integer d≥2d\ge2 as the number of array elements divisible by dd. Print an integer with the maximum score; any maximizer is accepted.

Input

The first line contains nn; the second line contains nn integers aia_i.

Output

Print any integer d≥2d\ge2 that maximizes the divisibility score.

Subtasks

  • Subtask 1 (20 points): 1≤n≤101\le n\le 10; 2≤ai≤602\le a_i\le 60.
  • Subtask 2 (30 points): 1≤n≤501\le n\le 50; 2≤ai≤5002\le a_i\le 500.
  • Subtask 3 (50 points): 1≤n≤1001\le n\le 100; 2≤ai≤1 0002\le a_i\le 1\,000.

Examples

Input

3
3 12 7

Output

3

Explanation

33 divides both 33 and 1212, giving a count of 2, which is optimal.