menu ZJOJ
account_circle 请登录
home
首页
book
题目
apps
分类
play_circle_outline
状态
assessment
竞赛
assignment
作业
equalizer
排名
assignment_ind
登录
person_add
注册
1552: 进击的奶牛
时间限制:1.000s
内存限制:128MB

题目描述

小紫建造了一个有 lns="http://www.w3.org/1998/Math/MathML">Nlns="http://www.w3.org/1998/Math/MathML">2 \leq N \leq 10 ^ 5) 个隔间的牛棚,这些隔间分布在一条直线上,坐标是 lns="http://www.w3.org/1998/Math/MathML">x _ 1, x _ 2, \cdots, x _ Nlns="http://www.w3.org/1998/Math/MathML">0 \leq x _ i \leq 10 ^ 9)。

他的 lns="http://www.w3.org/1998/Math/MathML">Clns="http://www.w3.org/1998/Math/MathML">2 \leq C \leq N)头牛不满于隔间的位置分布,它们为牛棚里其他的牛的存在而愤怒。为了防止牛之间的互相打斗,小紫想把这些牛安置在指定的隔间,所有牛中相邻两头的最近距离越大越好。那么,这个最大的最近距离是多少呢?

输入格式

第 lns="http://www.w3.org/1998/Math/MathML">1 行:两个用空格隔开的数字 lns="http://www.w3.org/1998/Math/MathML">N 和 lns="http://www.w3.org/1998/Math/MathML">C

第 lns="http://www.w3.org/1998/Math/MathML">2 \sim N+1 行:每行一个整数,表示每个隔间的坐标。

输出格式

输出只有一行,即相邻两头牛最大的最近距离。

样例输入 content_copy

5 3
1
2
8
4
9

样例输出 content_copy

3