P6539 [COCI 2013/2014 #1] ORGANIZATOR
Background
There is a competition, and you are asked to compute the number of people who advance to the final.
Description
The number of people who advance to the final satisfies the following rules:
You are given $n$ integers $A_1, A_2, \cdots, A_n$.
You need to find a positive integer $x$. Suppose there are $m$ ($m \geq 2$) values among $A_i$ that are multiples of $x$, then the number of finalists is $s$, whose value is $m \cdot x$.
Note that for a positive integer $x$, if the corresponding value of $m$ is $1$, then this choice is invalid.
Please find an $x$ that makes $s$ as large as possible, and output $s$.
Input Format
The first line contains a positive integer $n$.
The second line contains $n$ integers $A_i$ separated by spaces.
Output Format
Output an integer $s$.
Explanation/Hint
#### Explanation for Sample 1
Let $x = 2$. Then $A_{2,3}$ satisfy the condition, and the answer is $2 \times 2 = 4$.
#### Constraints
- For $30\%$ of the testdata, $n < 1000$.
- For $100\%$ of the testdata, $2 \le n \le 2 \times 10^5$, $1 \le A_i \le 2 \times 10^6$.
-----
#### Notes
**This problem is translated from [COCI2013-2014](https://hsin.hr/coci/archive/2013_2014/) [CONTEST #1](https://hsin.hr/coci/archive/2013_2014/contest1_tasks.pdf) _T5 ORGANIZATOR_.**
Translated by ChatGPT 5