当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1267:Fence

题目描述
Workers are going to enclose a new working region with a fence. For their convenience the enclosed area has to be as large as possible. They have N rectangular blocks to build the fence. The length of the i-th block is Li meters. All blocks have the same height of 1 meter. The workers are not allowed to break blocks into parts. All blocks must be used to build the fence.
输入解释
The first line of the input file contains one integer N (3 <= N <= 100).
The following N lines describe fence blocks. Each block is represented by its length in meters (integer number, 1 <= Li <= 100).
输出解释
Write to the output file one non-negative number S - maximal possible area of the working region (in square meters). S must be written with at least two digits after the decimal point. If it is not possible to construct the fence from the specified blocks, write 0.00.
输入样例
4
10
5
5
4
输出样例
28.00

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1267

最后修改于 2020-10-29T05:59:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000