Verkhovna Rada
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
For more than a year now, the issue of the number of People’s Deputies in the Verkhovna Rada has been acute in our society. The people do not want to support too many parasite deputies, but everything must be fair and each political party should receive a number of seats in parliament proportional to the number of votes it received in the elections. More formally, the ratio of the number of votes to the number of seats in the Verkhovna Rada must be the same for all parties.
\(n\) parties participated in the last elections to the Verkhovna Rada. You know the number of votes each of them received. Help the people minimize the total number of deputy seats.
Input
The first line gives a single natural number \(n\) — the number of parties.
The second line gives \(n\) natural numbers \(a_i\) — the number of votes received by the \(i\)-th party in the last elections.
Output
In a single line, output a single integer — the minimum total number of deputy seats in parliament.
Constraints
\(1 \le n \le 1000\),
\(1 \le a_i \le 10^9\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 3108 1624 5600 2268 | 450 |
Notes
The parties will receive the following numbers of deputy seats in the Verkhovna Rada:
111, 58, 200 and 81 respectively.
\(\frac{3108}{111} = \frac{1624}{58} = \frac{5600}{200} = \frac{2268}{81} = 28\).
Submit a solution
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|