#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define Waimai ios::sync_with_stdio(false),cin.tie(0)
#define FOR(x,a,b) for(int x=a;x<=b;x++)
#define pb emplace_back
#define F first
#define S second
const int SIZE = 2e5 + 5;
int N, K;
ll pre[SIZE];
double p1[SIZE], p2[SIZE];
tuple<double, double, int> st[SIZE];
int L, R;
pair<double, int> dp;
bool Del (tuple<double, double, int> t1, tuple<double, double, int> t2, double x) {
auto [m1, k1, c1] = t1;
auto [m2, k2, c2] = t2;
double v1 = m1 * x + k1, v2 = m2 * x + k2;
return v1 > v2 || (v1 == v2 && c1 >= c2);
}
bool Del (tuple<double, double, int> t1, tuple<double, double, int> t2, tuple<double, double, int> t) {
auto [m1, k1, c1] = t1;
auto [m2, k2, c2] = t2;
auto [m, k, c] = t;
double x1 = (k2 - k1) / (m1 - m2), x2 = (k - k1) / (m1 - m);
return x1 > x2 || (x1 == x2 && c2 >= c);
}
bool ok (double penalty) {
L = 1, R = 0;
st[++R] = {0, 0, 0};
dp = {0, 0};
FOR (i, 1, N) {
while (L + 1 <= R && Del (st[L], st[L + 1], p1[i])) L++;
auto [m, k, cnt] = st[L];
dp = {m * p1[i] + k + i + p2[i] + penalty, cnt + 1};
tuple<double, double, int> t = {-pre[i], dp.F - i - p2[i] + pre[i] * p1[i], dp.S};
while (L + 1 <= R && Del (st[R - 1], st[R], t)) R--;
st[++R] = t;
}
return dp.S <= K;
}
void solve() {
cin >> N >> K;
FOR (i, 1, N) {
int t;
cin >> t;
pre[i] = pre[i - 1] + t;
p1[i] = p1[i - 1] + 1.00 / t;
p2[i] = p2[i - 1] + 1.00 * pre[i - 1] / t;
}
double l = 0, r = N + p2[N];
FOR (t, 1, 100) {
double mid = (l + r) / 2;
if (ok (mid)) r = mid;
else l = mid;
}
ok (r);
cout << fixed << setprecision (16) << dp.F - K * r << '\n';
}
int main() {
Waimai;
solve();
}
I3ByYWdtYSBHQ0Mgb3B0aW1pemUoIk8zIikKI2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0gKGwgKyByKSAvIDI7CiAgICAgICAgaWYgKG9rIChtaWQpKSByID0gbWlkOwogICAgICAgIGVsc2UgbCA9IG1pZDsKICAgIH0KICAgIG9rIChyKTsKICAgIGNvdXQgPDwgZml4ZWQgPDwgc2V0cHJlY2lzaW9uICgxNikgPDwgZHAuRiAtIEsgKiByIDw8ICdcbic7Cn0KCmludCBtYWluKCkgewogICAgV2FpbWFpOwogICAgc29sdmUoKTsKfQ==