cho.sh
Notes
Loading...

Making Equal-Length Sticks

Time limit

3s

Memory limit

128 MB

Problem

Seungyeon originally had several sticks of the same integer length. Each stick was cut arbitrarily into pieces of integer length, and some sticks may not have been cut at all.

Now every cut piece must be used to restore sticks that all have the same length. Since the original number and length of the sticks are unknown, find the shortest possible length of one restored stick among all valid restorations.

Compute the minimum equal stick length that can be made using every piece.

Input

The input has two lines.

The first line contains N, the number of cut pieces. (1 <= N <= 100)

The second line contains N natural numbers separated by spaces, where each number is the length of a piece. Each length is at most 100.

Output

Print one integer: the minimum possible length of one restored stick.