博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
poj1011
阅读量:6698 次
发布时间:2019-06-25

本文共 896 字,大约阅读时间需要 2 分钟。

Description

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.

Input

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

Output

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

Sample Input

95 2 1 5 2 1 5 2 141 2 3 40

Sample Output

65 程序逻辑分析: 1、

转载于:https://www.cnblogs.com/premier/p/3852307.html

你可能感兴趣的文章
Java抽象类和接口
查看>>
Linux 终端下 dstat 监控工具
查看>>
Linux 关闭服务后 鼠标 键盘用不了
查看>>
hadoop hive 的安装问题
查看>>
Mysql 中 delete 与 left join 的问题
查看>>
Eclipse之ANT使用
查看>>
MYSQL AB复制原理
查看>>
git源码安装
查看>>
python读取excel
查看>>
修改终端服务端口的方法
查看>>
Web Service security UserNameToken 使用
查看>>
C++ 重载(overload)、重写(overrride)、重定义(redefine)总结
查看>>
Web3j源码之ObjectMapperFactory
查看>>
linux 程序包管理5 编译安装
查看>>
sudo应用
查看>>
【学神-RHEL7】1-3-Linux基本命令和配置服务器来电后自动开机
查看>>
AtomicInteger相关类
查看>>
I/O重定向
查看>>
SVN介绍
查看>>
Oracle中exp的使用2
查看>>