#include <bits/stdc++.h>
using namespace std;
const int N = 202020;
const long double INF = 1e100;
const long double EPS = 1e-10;
int n, k, a[N];
long double s[N], t[N], u[N], ans[2][N];
long double mult(const pair<long double, long double>& a,
                 const pair<long double, long double>& b) {
  return a.first * b.first + a.second * b.second;
}
bool bad(const pair<long double, long double>& a,
         const pair<long double, long double>& b,
         const pair<long double, long double>& c) {
  return ((c.first - b.first) * (b.second - a.second) -
              (c.second - b.second) * (b.first - a.first) <
          EPS);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    s[i + 1] = s[i] + a[i];
    t[i + 1] = t[i] + 1.0 / (long double)a[i];
    u[i + 1] = u[i] + s[i + 1] / (long double)a[i];
  }
  ans[0][0] = 0;
  for (int i = 0; i < n; ++i) ans[0][i + 1] = INF;
  for (int j = 1; j <= k; ++j) {
    ans[j & 1][0] = INF;
    vector<pair<long double, long double> > who;
    int pos = 0;
    who.push_back(make_pair(0, 0));
    for (int i = 1; i <= n; ++i) {
      pair<long double, long double> me = make_pair(1, -t[i]);
      while (pos + 1 < ((int)(who).size())) {
        long double cur_val = mult(who[pos], me);
        long double nxt_val = mult(who[pos + 1], me);
        if (cur_val < nxt_val - EPS) break;
        pos++;
      }
      assert(pos < ((int)(who).size()));
      ans[j & 1][i] = mult(who[pos], me) + u[i];
      pair<long double, long double> add =
          make_pair(ans[(j & 1) ^ 1][i] - u[i] + s[i] * t[i], s[i]);
      while (
          (pos + 1 < ((int)(who).size())) &&
          bad(who[((int)(who).size()) - 2], who[((int)(who).size()) - 1], add))
        who.pop_back();
      who.push_back(add);
    }
  }
  printf("%.10f\n", (double)ans[k & 1][n]);
  return 0;
}
