P1120 Small Wooden Sticks

Background

本题**不保证**存在**可以通过满足本题数据范围的任意数据**做法。可以通过此题的程序不一定完全正确(算法时间复杂度错误、或不保证正确性) 本题为搜索题,本题不接受 hack 数据。[关于此类题目的详细内容](https://www.luogu.com.cn/paste/pf94n89x)

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 $50$. 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 $n$, the number of stick pieces. The second line contains $n$ integers, the lengths $a_i$ of the pieces.

Output Format

Output a single integer on one line, representing the answer.

Explanation/Hint

For all testdata, $1 \leq n \leq 65$, $1 \leq a_i \leq 50$. Translated by ChatGPT 5