#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, K = 55;
int n, k;
int a[N];
long long pre[N];
double inv[N], w[N];
double f[N][K];
int s[N][2], top[2];
double X(int u) { return pre[u]; }
double Y(int u, int c) { return f[u][c] - w[u] + pre[u] * inv[u]; }
double Slope(int u, int v, int c) {
  return (Y(v, c) - Y(u, c)) / (X(v) - X(u));
}
double Cross(double x1, double x2, double y1, double y2) {
  return x1 * y2 - x2 * y1;
}
bool ck(int a, int u, int v, int c) {
  return Cross(X(u) - X(a), Y(u, c) - Y(a, c), X(v) - X(a), Y(v, c) - Y(a, c)) >
         0;
}
void DP() {
  for (int j = 1, l; j <= k; j++) {
    top[j & 1] = l = 0;
    for (int i = j; i <= n; i++) {
      while (l < top[!(j & 1)] - 1 &&
             inv[i] > Slope(s[l][!(j & 1)], s[l + 1][!(j & 1)], j - 1))
        l++;
      if (j == 1)
        f[i][1] = w[i];
      else {
        int t = s[l][!(j & 1)];
        f[i][j] = Y(t, j - 1) - inv[i] * X(t) + w[i];
      }
      while (top[j & 1] > 1 &&
             ck(s[top[j & 1] - 2][j & 1], i, s[top[j & 1] - 1][j & 1], j))
        top[j & 1]--;
      s[top[j & 1]++][j & 1] = i;
    }
  }
}
void Init() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    pre[i] = pre[i - 1] + a[i];
    inv[i] = inv[i - 1] + 1. / a[i];
    w[i] = w[i - 1] + (double)pre[i] / a[i];
  }
}
int main() {
  Init();
  DP();
  printf("%.10f\n", f[n][k]);
  return 0;
}
