This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include <bits/stdc++.h>
using namespace std;
int main() {
//cin读入优化
std::ios::sync_with_stdio(false);
//输入+输出重定向
freopen("../1296.txt", "r", stdin);
int n;
cin >> n;
vector<int> a(n + 1, 0);
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
int maxx = -1;
//两层循环,找到每组组合,然后取gcd,打擂台找到最大值
for (int j = 1; j <= n; j++) {
if (i == j) continue;
maxx = max(maxx, __gcd(a[i], a[j]));
cout << maxx << endl;
//关闭文件
fclose(stdin);
return 0;