#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const int N = 200100;
int n;
int m;
int t[N];
long double sum[N];
long double rev[N];
long double res[51][N];
pair<int, long double> q[N];
long double calc(int i, long long x, int k) {
  return x * rev[k] + (res[i - 1][k] - sum[k] * rev[k]);
}
long double cross(long double a1, long double b1, long double a2,
                  long double b2) {
  return (b2 - b1) / (a1 - a2);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%d", &t[i]);
  sum[n] = 0;
  rev[n] = 0;
  long double ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    sum[i] = sum[i + 1] + t[i];
    rev[i] = rev[i + 1] + (long double)1 / t[i];
    ans += t[i] * rev[i];
  }
  for (int i = 1; i <= m; i++) {
    int o = 1;
    q[0] = make_pair(n - i + 1, -1e100);
    for (int j = n - i; j >= 0; j--)
      if (i == 1)
        res[i][j] = 0;
      else {
        int l = 0, r = o;
        while (r - l > 1) {
          int s = (l + r) / 2;
          if (q[s].second < sum[j])
            l = s;
          else
            r = s;
        }
        res[i][j] = calc(i, sum[j], q[l].first);
        while (o > 1) {
          long double x = q[o - 1].second;
          if (calc(i, x, q[o - 1].first) < calc(i, x, j))
            o--;
          else
            break;
        }
        int k = q[o - 1].first;
        long double x = cross(rev[k], res[i - 1][k] - sum[k] * rev[k], rev[j],
                              res[i - 1][j] - sum[j] * rev[j]);
        q[o++] = make_pair(j, x);
      }
  }
  printf("%.10f\n", (double)(ans - res[m][0]));
  cerr << clock() << endl;
  return 0;
}
