Type: RemoteJudge 1000ms 256MiB

小木棍

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

乔治有一些同样长的小木棍,他把这些木棍随意砍成几段,直到每段的长都不超过 5050

现在,他想把小木棍拼接成原来的样子,但是却忘记了自己开始时有多少根木棍和它们的长度。

给出每段小木棍的长度,编程帮他找出原始木棍的最小可能长度。

输入格式

第一行是一个整数 nn,表示小木棍的个数。 第二行有 nn 个整数,表示各个木棍的长度 aia_i

输出格式

输出一行一个整数表示答案。

样例 #1

样例输入 #1

9
5 2 1 5 2 1 5 2 1

样例输出 #1

6

提示

对于全部测试点,1n651 \leq n \leq 651ai501 \leq a_i \leq 50

北辰OI俱乐部算法提高班:搜索专题

Not Claimed
Status
Done
Problem
12
Open Since
2023-11-24 0:00
Deadline
2024-12-31 23:59
Extension
24 hour(s)