Maximum GCD

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

Grammy has an array of length nn. She recently learned about the concept of greatest common divisor(GCD). Recall that the GCD of an array is the maximum integer dd such that every element in the array is divisible by dd. Grammy thinks that the GCD of an array should be as large as possible so that the array can be beautiful.

You want to help Grammy to make her array beautiful, so you decided to do some (possibly zero) modulo operations on each of the elements in the array. In other words, for each operation, you can choose a number a_ia\_i (1in1 \leq i \leq n) in the array and choose another integer xx, and then replace a_ia\_i with (a_imodx)(a\_i\bmod x). Since Grammy does not want 00 to appear in her array, you cannot change a_ia\_i into 00 by doing the modulo operation.

Now, your task is to calculate the maximum GCD of the array after several (possibly zero) modulo operations.

입력

The first line contains a single integer nn (1n1051 \leq n \leq 10^5), denoting the number of elements in the array.

The second line contains nn positive integers a_ia\_i (1a_i1091 \leq a\_i \leq 10^9), denoting the initial elements of Grammy's array.

출력

Output a single integer, denoting the maximum GCD of the array after any number of modulo operations.