#include <bits/stdc++.h>
using namespace std;
using REAL = long double;
int n, m, opt[200200][60];
REAL E[200200][60], pre[200200], sum[200200], inv[200200];
void compute(int l, int r, int k, int L, int R) {
  int i = (l + r) >> 1;
  E[i][k] = -1;
  for (int j = min(i, R); j >= max(k, L); --j) {
    if (E[i][k] == -1 || E[i][k] > E[j - 1][k - 1] + pre[i] - pre[j - 1] -
                                       (inv[i] - inv[j - 1]) * sum[j - 1]) {
      E[i][k] = E[j - 1][k - 1] + pre[i] - pre[j - 1] -
                (inv[i] - inv[j - 1]) * sum[j - 1];
      opt[i][k] = j;
    }
  }
  if (l < i) {
    compute(l, i - 1, k, L, opt[i][k]);
  }
  if (i < r) {
    compute(i + 1, r, k, opt[i][k], R);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1, u; i <= n; ++i) {
    scanf("%d", &u);
    REAL v = (REAL)u;
    sum[i] = sum[i - 1] + v;
    pre[i] = pre[i - 1] + sum[i] / v;
    inv[i] = inv[i - 1] + 1 / v;
    E[i][1] = pre[i];
    opt[i][1] = 1;
  }
  for (int k = 2; k <= m; ++k) {
    compute(1, n, k, k, n);
  }
  cout << setprecision(9) << fixed << E[n][m] << "\n";
  return 0;
}
