2579Sticks

2579   Sticks

题目描述

George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many sticks he had originally and how long they were originally. Please help him and design a program which computes the smallest possible original length of those sticks. All lengths expressed in units are integers greater than zero.

输入格式:

The input file contains blocks of 2 lines. The first line contains the number of sticks parts after cutting. The second line contains the lengths of those parts separated by the space. The last line of the file contains zero.

输出格式:

The output file contains the smallest possible length of original sticks, one per line.

输入样例 复制
9
5 2 1 5 2 1 5 2 1
4
1 2 3 4
0
输出样例 复制
6
5

说明

8
22
通过提交
时空限制1000ms/128mb
题目来源
评测方式在线评测
题目类型
难        度