UKIEPC2017 . I Work All Day(水题)

问题 I: I Work All Day

时间限制: 1 Sec  内存限制: 128 MB  Special Judge
提交: 74  解决: 69
[提交] [状态] [讨论版] [命题人:admin]

题目描述

Michael is a lumberjack, and a pretty OK one at that. However, automation is making fast (if polite) inroads to his business, and he needs to stay ahead to remain competitive.
To this end, he has invented a machine called the Flannelmaster GTX. This is a fearsome tree- cutting contraption, powered by logarithms, which swings an axe horizontally from a specified height above the ground. Each impact of its electronic axe cuts the tree cleanly into two parts, the stump rolling away and the remainder of the tree falling down into the same place.
This continues until the remaining height is too small to cut any more, at which point any irregular-sized stump is discarded as waste and the remaining lumber of the same length as the setting is neatly packaged and sold on automatically.
What setting should Michael use for the height in order to minimise loss?

 

 

输入

• One line containing the integer N (2 ≤ N ≤ 10), the number of settings;
• One line containing N distinct integers Hi (1 ≤ H ≤ 500), the possible settings;
• One line containing the integer T (1 ≤ T ≤ 3000), the height of the tree.

 

 

输出

Output the best setting to use so that tree waste will be minimal. If there are multiple settings that yield equally small waste, you may print any one of them.

 

样例输入

3
5 6 8
103

 

样例输出

6
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值