#D. 最大公约数

    Type: Default 1000ms 256MiB

最大公约数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

nn 个整数, a1,a2,...,ana_1, a_2, ..., a_n

你最多可以修改其中一个数,也可以不修改。

问操作后,这些数的最大公约数最大是多少。

Format

Input

第一行一个整数 nn,表示数的个数。

第二行 nn 个整数。

Output

一个整数,表示答案。

Samples

3
2 12 8
4

将第一个数修改成4.

Limitation

30%: ai105a_i \le 10^5

另有30%: n1000n \le 1000

100% 3n1053 \le n \le 10^5, 1ai1091\le a_i \le 10^9

初一A随堂练习

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2025-9-19 10:30
End at
2025-9-19 12:30
Duration
2 hour(s)
Host
Partic.
29