Codeforces Round 424 (Div. 2, rated, based on VK Cup Finals)
F
Bamboo Partition
Codeforces
未评级
原题
← E→
翻译中…

Vladimir wants to modernize partitions in his office. To make the office more comfortable he decided to remove a partition and plant several bamboos in a row. He thinks it would be nice if there are $*n*$ bamboos in a row, and the $*i*$-th from the left is $*a*_{*i*}$ meters high.

翻译中…

Vladimir has just planted $*n*$ bamboos in a row, each of which has height $0$ meters right now, but they grow $1$ meter each day. In order to make the partition nice Vladimir can cut each bamboo once at any height (no greater that the height of the bamboo), and then the bamboo will stop growing.

翻译中…

Vladimir wants to check the bamboos each $*d*$ days (i.e. $*d*$ days after he planted, then after $2*d*$ days and so on), and cut the bamboos that reached the required height. Vladimir wants the total length of bamboo parts he will cut off to be no greater than $*k*$ meters.

翻译中…

What is the maximum value $*d*$ he can choose so that he can achieve what he wants without cutting off more than $*k*$ meters of bamboo?

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*k*$ ($1 ≤ *n* ≤ 100$, $1 ≤ *k* ≤ 10^{11}$) — the number of bamboos and the maximum total length of cut parts, in meters.

翻译中…

The second line contains $*n*$ integers $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 10^{9}$) — the required heights of bamboos, in meters.

翻译中…

Output

翻译中…

Print a single integer — the maximum value of $*d*$ such that Vladimir can reach his goal.

翻译中…

Note

翻译中…

In the first example Vladimir can check bamboos each $3$ days. Then he will cut the first and the second bamboos after $3$ days, and the third bamboo after $6$ days. The total length of cut parts is $2 + 0 + 1 = 3$ meters.

翻译中…

样例

Input #1
3 4
1 3 5
Output #1
3
InputCopy OutputCopy
Input #2
3 40
10 30 50
Output #2
32
InputCopy OutputCopy
题目信息
题号
831F
时间限制
2 s
内存限制
512 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。