#Lutece3266. 基础 LCM 练习题

基础 LCM 练习题

Migrated from Lutece 3266 基础 LCM 练习题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

给定长为 nn 的数列 {a}\{a\},求两两 LCM\text{LCM} 的最大值,即:

max1i<jnLCM(ai,aj)\max_{1\le i<j\le n} \text{LCM}(a_i,a_j)

其中 LCM\text{LCM} 指的是最小公倍数。

Input

第一行一个正整数 nn,表示数列长度。 第二行 nn 个正整数 a1,a2,,ana_1,a_2,\dots,a_n

Output

一行一个正整数表示答案。

Samples

3
13 35 77
1001
6
1 2 4 8 16 32
32

Constraints

2n1062\le n\le 10^6 , 1ai1061\le a_i\le 10^6

Resources

2024 UESTC ICPC Training for Math