1. Abridged Problem Statement
Given n distinct positive integers (each ≤ 2^20), find the maximum greatest common divisor (GCD) among all pairs of these numbers.

2. Detailed Editorial
Goal: Maximize gcd(a, b) over all 1 ≤ i < j ≤ n.

Observation: For any candidate d, gcd(a, b) ≥ d if and only if both a and b are multiples of d. So the largest d for which at least two input numbers are divisible by d is achievable as a gcd of some pair.

Approach:
- Let M = 2^20 (upper bound on values).
- Create a boolean array used[1…M−1], marking which integers appear in input.
- For each d from 1 to M−1, count how many multiples of d appear: sum over j = d, 2d, 3d, … of used[j].
- If the count ≥ 2, d is a candidate gcd. Track the maximum d found.
- Output that maximum.

Complexity:
- Building the used[] array: O(n).
- Summing multiples for each d: ∑_{d=1 to M} (M/d) = O(M log M) ≈ 20·10^6, fits in 0.5 s in C++.
- Memory: O(M).

3. C++ Solution

```cpp
#include <bits/stdc++.h>

using namespace std;

template<typename T1, typename T2>
ostream& operator<<(ostream& out, const pair<T1, T2>& x) {
    return out << x.first << ' ' << x.second;
}

template<typename T1, typename T2>
istream& operator>>(istream& in, pair<T1, T2>& x) {
    return in >> x.first >> x.second;
}

template<typename T>
istream& operator>>(istream& in, vector<T>& a) {
    for(auto& x: a) {
        in >> x;
    }
    return in;
};

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& a) {
    for(auto x: a) {
        out << x << ' ';
    }
    return out;
};

const int MAXN = (1 << 20);

int n;
bool used[MAXN];

void read() {
    cin >> n;
    for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        used[x] = 1;
    }
}

void solve() {
    // used[x] marks which friendship numbers are present. The answer is the
    // largest g that divides at least two of the given numbers, since that g is
    // an achievable gcd of some pair. For each candidate divisor i we count how
    // many present numbers are multiples of i by scanning i, 2i, 3i, ...; if at
    // least two are present then i is a feasible gcd, and we keep the maximum
    // such i. This is a harmonic-sum sieve over the value range.

    int answer = 1;
    for(int i = 1; i < MAXN; i++) {
        int cnt = 0;
        for(int j = i; j < MAXN; j += i) {
            cnt += used[j];
        }

        if(cnt >= 2) {
            answer = max(answer, i);
        }
    }

    cout << answer << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T = 1;
    // cin >> T;
    for(int test = 1; test <= T; test++) {
        read();
        // cout << "Case #" << test << ": ";
        solve();
    }

    return 0;
}
```

4. Python Solution

```python
import sys
def main():
    data = sys.stdin.read().split()
    n = int(data[0])
    nums = list(map(int, data[1:]))

    M = 1 << 20
    used = [False] * M
    # Mark presence
    for x in nums:
        used[x] = True

    answer = 1
    # For each possible gcd d
    for d in range(1, M):
        cnt = 0
        # Check multiples of d
        for j in range(d, M, d):
            if used[j]:
                cnt += 1
                if cnt >= 2:
                    # We found at least two multiples, update answer
                    answer = max(answer, d)
                    break
    print(answer)

if __name__ == "__main__":
    main()
```

5. Compressed Editorial
- Mark all input numbers in a boolean array up to 2^20.
- For each d from 1 to 2^20–1, count present multiples of d.
- If count ≥2, d is a candidate gcd; track the maximum.
- Time O(M log M), memory O(M).
