#include <bits/stdc++.h>
#define endl '\n'
#define double long double
using namespace std;
const int MAXN = (1 << 20);
int n;
int64_t k, a[MAXN];
void read()
{
cin >> n >> k;
for(int i = 0; i < n; i++)
cin >> a[i];
}
double f(double p, double c, double a)
{
return p * c + a / p;
}
double dp[MAXN];
double lga[MAXN];
int64_t solve(double cost)
{
int64_t ret = 0;
double lgc = log(1.0 / sqrt(cost));
double lgk = log(k);
for(int i = 0; i < n; i++)
{
int64_t ck = (int64_t)(sqrt(a[i]) / sqrt(cost));
if(lga[i] + lgc > lgk) return k + 1;
int64_t low = (int64_t)ck;
int64_t high = (int64_t)ck + 1;
double c_ret = (int64_t)1e17;
int64_t c_pos = 0;
for(int64_t candidate = low; candidate <= high; candidate++)
if(c_ret > f(candidate, cost, a[i]))
{
c_ret = f(candidate, cost, a[i]);
c_pos = candidate;
}
ret += c_pos;
dp[i] = ((i) ? dp[i - 1] : 0) + (double)a[i] / (double)c_pos;
if(ret > k) return ret;
}
return ret;
}
void solve()
{
for(int i = 0; i < n; i++)
lga[i] = log(sqrt(a[i]));
double low = 0, high = 1e3, mid, ret;
for(int ops = 0; ops < 69; ops++)
{
mid = (low + high) / 2.0;
if(solve(mid) <= k) high = mid, ret = mid;
else low = mid;
}
solve(ret);
cout << (int64_t)(dp[n - 1] + 0.5) << endl;
}
int main()
{
freopen("tallbarn.in", "r", stdin);
freopen("tallbarn.out", "w", stdout);
ios_base::sync_with_stdio(false);
cin.tie(NULL);
read();
solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgZW5kbCAnXG4nCgojZGVmaW5lIGRvdWJsZSBsb25nIGRvdWJsZQoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKY29uc3QgaW50IE1BWE4gPSAoMSA8PCAyMCk7CgppbnQgbjsKaW50NjRfdCBrLCBhW01BWE5dOwoKdm9pZCByZWFkKCkKewoJY2luID4+IG4gPj4gazsKCWZvcihpbnQgaSA9IDA7IGkgPCBuOyB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