#include <bits/stdc++.h>
using namespace std;
double s[200005], g[200005], f[200005], b[200005];
double dp[200005][55];
int q[200005];
int main() {
  int n, k, i, j, x;
  int head, tail;
  scanf("%d%d", &n, &k);
  s[0] = g[0] = f[0] = 0;
  dp[0][1] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    s[i] = s[i - 1] + x;
    g[i] = g[i - 1] + 1.0 / x;
    f[i] = f[i - 1] + s[i - 1] / x;
    dp[i][1] = f[i];
  }
  for (i = 2; i <= k; i++) {
    dp[0][i] = 0;
    head = tail = 0;
    b[0] = 0;
    q[tail++] = 0;
    for (j = 1; j <= n; j++) {
      while (head + 1 < tail && g[j] * (s[q[head + 1]] - s[q[head]]) >=
                                    (b[q[head + 1]] - b[q[head]]))
        head++;
      dp[j][i] = f[j] + b[q[head]] - g[j] * s[q[head]];
      b[j] = s[j] * g[j] + dp[j][i - 1] - f[j];
      while (head + 1 < tail &&
             (s[q[tail - 1]] - s[q[tail - 2]]) * (b[j] - b[q[tail - 1]]) <=
                 (s[j] - s[q[tail - 1]]) * (b[q[tail - 1]] - b[q[tail - 2]]))
        tail--;
      q[tail++] = j;
    }
  }
  printf("%.10f\n", dp[n][k] + n);
  return 0;
}
