#include <bits/stdc++.h>
const int N = 200005;
int t[N], q[N], n, k, l, r;
double f[N][2], s[N], ss[N], st[N];
double cost(int l, int r) { return ss[r] - ss[l] - (st[r] - st[l]) * s[l]; }
double slip(int i, int j, int k) {
  return (f[j][i & 1] + st[j] * s[j] - ss[j] - f[k][i & 1] - st[k] * s[k] +
          ss[k]) /
         (s[j] - s[k]);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++)
    scanf("%d", &t[i]), s[i] = s[i - 1] + t[i], st[i] = st[i - 1] + 1.0 / t[i];
  for (int i = 1; i <= n; i++) ss[i] = ss[i - 1] + s[i] / t[i];
  for (int i = 1; i <= n; i++) f[i][0] = 1e30;
  for (int j = 1; j <= k; j++) {
    l = 1, q[r = 1] = 0;
    for (int i = 1; i <= n; i++) {
      while (l < r && slip(j - 1, q[l], q[l + 1]) < st[i]) l++;
      f[i][j & 1] = f[q[l]][(j & 1) ^ 1] + cost(q[l], i);
      while (l < r && slip(j - 1, q[r - 1], q[r]) >= slip(j - 1, q[r], i)) r--;
      q[++r] = i;
    }
  }
  printf("%.10f", f[n][k & 1]);
  return 0;
}
