1757:木材加工

文件提交:无需freopen 内存限制:128 MB 时间限制:1.000 S
评测方式:普通裁判 命题人:
提交:3 解决:2

题目描述

木材厂有 lns="http://www.w3.org/1998/Math/MathML"> 根原木,现在想把这些木头切割成 lns="http://www.w3.org/1998/Math/MathML"> 段长度为 lns="http://www.w3.org/1998/Math/MathML"> 的小段木头(木头有可能有剩余)。

当然,我们希望得到的小段木头越长越好,请求出 lns="http://www.w3.org/1998/Math/MathML"> 的最大值。

木头长度的单位是 lns="http://www.w3.org/1998/Math/MathML">cm,原木的长度都是正整数,我们要求切割得到的小段木头的长度也是正整数。

例如有两根原木长度分别为 lns="http://www.w3.org/1998/Math/MathML">11 和 lns="http://www.w3.org/1998/Math/MathML">21,要求切割成等长的 lns="http://www.w3.org/1998/Math/MathML">6 段,很明显能切割出来的小段木头长度最长为 lns="http://www.w3.org/1998/Math/MathML">5

输入

第一行是两个正整数 lns="http://www.w3.org/1998/Math/MathML">,,分别表示原木的数量,需要得到的小段的数量。

接下来 lns="http://www.w3.org/1998/Math/MathML"> 行,每行一个正整数 lns="http://www.w3.org/1998/Math/MathML">,表示一根原木的长度。

对于 lns="http://www.w3.org/1998/Math/MathML">100% 的数据,有 lns="http://www.w3.org/1998/Math/MathML">1105lns="http://www.w3.org/1998/Math/MathML">1108lns="http://www.w3.org/1998/Math/MathML">1108([1,])


输出

仅一行,即 lns="http://www.w3.org/1998/Math/MathML"> 的最大值。

如果连 lns="http://www.w3.org/1998/Math/MathML">1cm 长的小段都切不出来,输出 0

样例输入-1 复制

3 7
232
124
456

样例输出-1 复制

114