#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 6;
const int MAX_K = 52;
int id;
double dp[MAX_K][MAX_N];
double tt[MAX_N];
double st[MAX_N];
double _st[MAX_N];
double s[MAX_N];
double f(int i) { return s[i]; }
double g(int j) { return dp[id][j] - s[j] + st[j] * _st[j]; }
double h(int i) { return -_st[i]; }
double t(int j) { return st[j]; }
struct Line {
  double m, b;
  Line(double _m, double _b) {
    m = _m;
    b = _b;
  }
  double val(double x) { return m * x + b; }
};
bool check(Line _1, Line _2, Line _3) {
  return (_1.m - _3.m) * (_1.b - _2.b) <= (_1.b - _3.b) * (_1.m - _2.m);
}
int main() {
  int n, K;
  while (scanf("%d %d", &n, &K) != EOF) {
    for (int i = 1; n >= i; i++) {
      scanf("%lf", &tt[i]);
      st[i] = st[i - 1] + tt[i];
      _st[i] = _st[i - 1] + 1.0 / double(tt[i]);
      s[i] = s[i - 1] + double(st[i]) / double(tt[i]);
    }
    for (int i = 1; n >= i; i++) {
      dp[1][i] = s[i];
    }
    for (int k = 2; K >= k; k++) {
      id = k - 1;
      deque<Line> dq;
      dq.push_back(Line(0, 0));
      for (int i = 1; n >= i; i++) {
        while (dq.size() > 1 && dq[0].val(h(i)) > dq[1].val(h(i)))
          dq.pop_front();
        dp[k][i] = f(i) + dq[0].val(h(i));
        Line newline = Line(t(i), g(i));
        while (dq.size() > 1 &&
               check(newline, dq[dq.size() - 1], dq[dq.size() - 2])) {
          dq.pop_back();
        }
        dq.push_back(newline);
      }
    }
    printf("%.10f\n", dp[K][n]);
  }
}
