Common Divisors
The largest greatest common divisor of two elements at distinct positions.
You are given an array of positive integers. Your task is to find two integers such that their greatest common divisor is as large as possible.
Input
The first input line has an integer : the size of the array.
The second line has integers : the contents of the array.
Output
Print the maximum greatest common divisor.
Constraints
Example
Input:
5 3 14 15 7 9
Output:
7
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/CommonDivisors/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions1 qualifying submission. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
1 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 1.000 | 1,064,625,075 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-25 11:28 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.