#include <bits/stdc++.h>
using namespace std;
const int MX = 200111;
double dp[MX][55];
int Q[55][2 * MX], t[MX];
int L[55], R[55];
double g[MX], s[MX], f[MX];
int n, K;
inline double Cross(double ax, double ay, double bx, double by) {
  return ax * by - ay * bx;
}
inline double Y(int j, int k) { return dp[j][k] - g[j] + f[j] * s[j]; }
inline double X(int j) { return s[j]; }
int main() {
  while (scanf("%d%d", &n, &K) == 2) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &t[i]);
      s[i] = s[i - 1] + t[i];
      g[i] = g[i - 1] + s[i] / t[i];
      f[i] = f[i - 1] + 1.0 / t[i];
    }
    memset(L, 0, sizeof(L));
    memset(R, 0, sizeof(R));
    Q[0][R[0]++] = 0;
    dp[0][0] = 0;
    for (int i = 1; i <= n; i++) {
      for (int k = min(i, K); k; k--) {
        int& l = L[k - 1];
        int& r = R[k - 1];
        int* q = Q[k - 1];
        while (l + 1 < r && f[i] * (X(q[l + 1]) - X(q[l])) >=
                                Y(q[l + 1], k - 1) - Y(q[l], k - 1))
          l++;
        dp[i][k] = g[i] + -f[i] * X(q[l]) + Y(q[l], k - 1);
        {
          int& l = L[k];
          int& r = R[k];
          q = Q[k];
          while (l + 1 < r &&
                 Cross(X(q[r - 1]) - X(q[r - 2]),
                       Y(q[r - 1], k) - Y(q[r - 2], k), X(i) - X(q[r - 1]),
                       Y(i, k) - Y(q[r - 1], k)) <= 1e-8)
            r--;
          q[r++] = i;
        }
      }
    }
    printf("%.9f\n", dp[n][min(n, K)]);
  }
  return 0;
}
