| Insomnia 2025 |
|---|
| Finished |
Alice gives you an array $$$a$$$ of size $$$n$$$. You can perform the following operation any number of times (including zero):
Bob being the troublemaker he is, orders you to change $$$\textbf{exactly one}$$$ element in the array before performing the above operation. Your goal is to maximize the gcd of the whole array, $$$gcd(a_1,a_2,...,a_n)$$$.
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each testcase contains a single integer $$$n$$$ ($$$2\le n\le 10^5$$$) — the size of the array $$$a$$$.
The second line contains $$$n$$$ integers $$$a_1$$$,$$$a_2$$$,…,$$$a_n$$$ ($$$1\le a_i\le 10^9$$$) — the elements of array $$$a$$$.
The sum of $$$n$$$ over all testcases does not exceed $$$10^6$$$.
Output a single integer for each testcase — the maximum possible value of $$$gcd(a_1,a_2,...,a_n)$$$.
325 554 4 4 2 473 6 12 990 9 12 15
5 4 3
| Name |
|---|


