#include <bits/stdc++.h>
using namespace std;
int n, k;
int t[222222];
double rsumt[222222], sumt[222222];
double A[222222], B[222222];
double dp[222222];
int q[222222], head, tail;
int main() {
  scanf("%d%d", &n, &k);
  double res = 0.0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    rsumt[i] = rsumt[i - 1] + 1.0 / t[i];
    sumt[i] = sumt[i - 1] + t[i];
    res += sumt[i] / t[i];
  }
  for (int iter = 0; iter < k; ++iter) {
    head = tail = 0;
    q[tail++] = 0;
    for (int i = 1; i <= n; i++) {
      double x = rsumt[i];
      while (head + 1 < tail && A[q[head]] * x + B[q[head]] <
                                    A[q[head + 1]] * x + B[q[head + 1]]) {
        head++;
      }
      double cur = A[q[head]] * x + B[q[head]];
      B[i] = dp[i] - sumt[i] * rsumt[i];
      A[i] = sumt[i];
      while (head + 1 < tail &&
             (B[q[tail - 1]] - B[q[tail - 2]]) /
                     (A[q[tail - 2]] - A[q[tail - 1]]) >=
                 (B[i] - B[q[tail - 2]]) / (A[q[tail - 2]] - A[i])) {
        --tail;
      }
      if (iter > 0) {
        q[tail++] = i;
      }
      dp[i] = cur;
    }
  }
  res -= dp[n];
  printf("%.10lf\n", res);
  return 0;
}
