#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int N, K, T[maxn];
double A[maxn], B[maxn], S[maxn], dp[2][maxn];
int que[2 * maxn];
double Y(int cur, int k, int j) {
  return (dp[cur][j] - A[j] + S[j] * B[j]) - (dp[cur][k] - A[k] + S[k] * B[k]);
}
double X(int k, int j) { return S[j] - S[k]; }
int main() {
  while (~scanf("%d%d", &N, &K)) {
    for (int i = 1; i <= N; i++) {
      scanf("%d", &T[i]);
      S[i] = S[i - 1] + T[i];
      A[i] = A[i - 1] + S[i] / T[i];
      B[i] = B[i - 1] + 1.0 / T[i];
      dp[1][i] = A[i];
    }
    for (int k = 2, cur, las, head, tail; k <= K; k++) {
      head = 0, tail = 0;
      cur = k & 1, las = (k - 1) & 1;
      que[tail++] = 0;
      memset(dp[cur], 0, sizeof(dp[cur]));
      for (int i = 1; i <= N; i++) {
        while (tail - head > 1 && Y(las, que[head], que[head + 1]) <
                                      X(que[head], que[head + 1]) * B[i])
          head++;
        int p = que[head];
        dp[cur][i] = dp[las][p] + A[i] - A[p] - S[p] * (B[i] - B[p]);
        while (tail - head > 1 &&
               Y(las, que[tail - 1], i) * X(que[tail - 2], que[tail - 1]) -
                       Y(las, que[tail - 2], que[tail - 1]) *
                           X(que[tail - 1], i) <=
                   0)
          tail--;
        que[tail++] = i;
      }
    }
    printf("%.6f\n", dp[K & 1][N]);
  }
}
