#P1120. [CERC 1995] 小木棍
[CERC 1995] 小木棍
Description
George has some small wooden sticks of equal length. He randomly cut these sticks into several pieces until each piece had length no more than .
Now he wants to reassemble the sticks to their original form, but he has forgotten how many sticks he started with and what their lengths were.
Given the lengths of all the pieces, write a program to find the minimal possible length of the original sticks.
Input Format
The first line contains an integer , the number of stick pieces.
The second line contains integers, the lengths of the pieces.
Output Format
Output a single integer on one line, representing the answer.
9
5 2 1 5 2 1 5 2 1
6
Hint
For all testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号