#Q21. 「一本通 1.3 例 3」小木棍

「一本通 1.3 例 3」小木棍

Description

Original Source: CERC 1995

George has some small sticks of equal length. He randomly cuts them into several segments until each segment is no longer than 5050. Now, he wants to reassemble the small sticks back to their original form, but he has forgotten how many sticks he started with and their original lengths. Given the lengths of each small stick segment, write a program to help him find the smallest possible original length of the sticks.

Input Format

The first line contains a single integer NN representing the total number of small stick segments after cutting. The second line contains NN positive integers separated by spaces, representing the lengths of the NN small stick segments.

Output Format

Output a single line representing the smallest possible original length of the sticks.

Sample 1

9
5 2 1 5 2 1 5 2 1

6

Constraints & Hints

1N601 \leq N \leq 60