#include <bits/stdc++.h>
int n, k;
double f[200200][55], s[200200], t[200200], sum;
struct node {
  double k, b;
} q[200200];
double cross(node a, node b) { return (b.b - a.b) / (a.k - b.k); }
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lf", &s[i]);
  for (int i = 1; i <= n; i++) {
    sum += (s[i - 1] + s[i]) / s[i];
    t[i] = t[i - 1] + 1.0 / s[i];
    s[i] += s[i - 1];
  }
  for (int i = 1; i < k; i++) {
    int l = 1, r = 0;
    for (int j = 1; j <= n; j++) {
      if (l > r)
        f[j][i] = 0;
      else {
        while (l < r && q[l].k * t[j] + q[l].b < q[l + 1].k * t[j] + q[l + 1].b)
          l++;
        f[j][i] = q[l].k * t[j] + q[l].b;
      }
      r++;
      q[r].k = s[j];
      q[r].b = f[j][i - 1] - s[j] * t[j];
      while (r - l > 1 && cross(q[r], q[r - 2]) < cross(q[r - 1], q[r - 2])) {
        r--;
        q[r] = q[r + 1];
      }
    }
  }
  printf("%.8lf\n", sum - f[n][k - 1]);
  return 0;
}
