codeforces 1607C.Minimum Extraction

C.Minimum Extraction

Yelisey has an array a of n integers.

If a has length strictly greater than 1, then Yelisei can apply an
operation called minimum extraction to it:

First, Yelisei finds the minimal number m in the array. If there are
several identical minima, Yelisey can choose any of them. Then the
selected minimal element is removed from the array. After that, m is
subtracted from each remaining element. Thus, after each operation,
the length of the array is reduced by 1.

For example, if a=[1,6,−4,−2,−4], then the minimum element in it is
a3=−4, which means that after this operation the array will be equal
to a=[1−(−4),6−(−4),−2−(−4),−4−(−4)]=[5,10,2,0].

Since Yelisey likes big numbers, he wants the numbers in the array a
to be as big as possible.

Formally speaking, he wants to make the minimum of the numbers in
array a to be maximal possible (i.e. he want to maximize a minimum).
To do this, Yelisey can apply the minimum extraction operation to the
array as many times as he wants (possibly, zero). Note that the
operation cannot be applied to an array of length 1.

Help him find what maximal value can the minimal element of the array
have after applying several (possibly, zero) minim

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值