#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long double PI = acosl(-1);
const long long infl = 1e15;
const int inf = 2e9 + 5;
const int nmax = 2e5 + 10;
const int MAXLG = log2(nmax) + 1;
int arr[nmax];
long long sam[nmax];
long double rev[nmax], pre[nmax];
long double dp[nmax];
int koyta[nmax];
bool Q;
struct Line {
  mutable long double m, c, p, idx;
  bool operator<(const Line& o) const { return Q ? p < o.p : m < o.m; }
};
struct LineContainer : multiset<Line> {
  const long double inf = 1 / .0;
  long double div(long double a, long double b) { return a / b; }
  bool isect(iterator x, iterator y) {
    if (y == end()) {
      x->p = inf;
      return false;
    }
    if ((fabs((x->m) - (y->m)) < 1e-8))
      x->p = x->c > y->c ? inf : -inf;
    else
      x->p = div(y->c - x->c, x->m - y->m);
    return x->p + 1e-8 >= y->p;
  }
  void addLine(long double m, long double c, long double idx) {
    auto z = insert({m, c, 0, idx}), y = z++, x = y;
    while (isect(y, z)) z = erase(z);
    if (x != begin() && isect(--x, y)) isect(x, y = erase(y));
    while ((y = x) != begin() && (--x)->p >= y->p) isect(x, erase(y));
  }
  pair<long double, long double> query(long double x) {
    assert(!empty());
    Q = 1;
    auto l = *lower_bound({0, 0, x, 0.0});
    Q = 0;
    return {l.m * x + l.c, l.idx};
  }
  bool isEmpty() { return (empty()); }
  void Clear() { clear(); }
} hal;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    rev[i] = rev[i - 1] + 1.0 / arr[i];
    sam[i] = sam[i - 1] + arr[i];
    pre[i] = pre[i - 1] + 1.0 * sam[i] / arr[i];
  }
  long double lo = 0.0, hi = 1.0 * pre[n];
  long double ans = 1.0 * infl;
  int mxit = 100;
  while (lo < hi and mxit--) {
    long double mid = (lo + hi) / 2.0;
    for (int i = 0; i <= n; i++) dp[i] = 0.0, koyta[i] = 0;
    hal.addLine(0.0, 0.0, 0.0);
    for (int i = 1; i <= n; i++) {
      auto z = hal.query(rev[i]);
      dp[i] = -z.first + pre[i] + mid;
      int idx = nearbyint(z.second);
      koyta[i] = koyta[idx] + 1;
      long double mm = -sam[i];
      long double cc = rev[i] * sam[i] - pre[i] + dp[i];
      hal.addLine(-mm, -cc, 1.0 * i);
    }
    hal.clear();
    int kk = koyta[n];
    if (kk <= k) {
      hi = mid;
      long double ans1 = dp[n] - mid * k;
      ans = ans1;
      if (kk == k) break;
    } else {
      lo = mid;
    }
  }
  cout << fixed << setprecision(12) << ans;
}
