Type: Default 1000ms 256MiB

木材加工

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

木材厂有 n 根原木,现在想把这些木头切割成 k 段长度均为 l 的小段木头(木头有可能有剩余。

当然,我们希望得到的小段木头越长越好,请求出 l 的最大值。

木头长度的单位是}cm,原木的长度都是正整数,我们要求切割得到的小段木头的长度也是正整数。

例如有两根原木长度分别为 11 和 21,要求切割成等长的 6 段,很明显能切割出来的小段木头长度最长为 5。

Input

第一行是两个正整数n,k分别表示原木的数量,需要得到的小段的数量。

接下来 n 行,每行一个正整数 L_i,表示一根原木的长度。

Output

仅一行,即 l 的最大值。

如果连 1cm 长的小段都切不出来,输出 0。

Samples

3 7
232
124
456
114

Limitation

1s, 1024KiB for each test case.

二分训练

Not Claimed
Status
Done
Problem
11
Open Since
2022-11-29 19:00
Deadline
2022-12-5 0:00
Extension
24 hour(s)