You are given an array (a1, a2, ..., an) with each element has integral value. We define the GCD (greatest common divisor) of the array to be the largest positive integer that divides all the elements in the array.
Now, you need to delete a element from the array, determine what is the maximum GCD of this new array can be.
For example, if the given array is [15, 18, 30, 90], then:
So the answer is 15.
The first line contain an integer n, representing the length of array.
The second line contain n integers a1, a2, ..., an, each ai and ai+1 are seperated by a blank.
Output the maximum GCD of the array after deleting an element in one line. You need to add '\n' at the end.
If you use a brute force method to solve the problem, you may get a time limit exceed on testcase5. It may be more suitable to think how to solve testcase5 efficiently after solving other problems.