#include <bits/stdc++.h>
using namespace std;
double f[200007][57];
double x[200007], y[200007];
double pre[200007], sum[200007], rev[200007];
int stk[200007], cnt;
int n, K;
int t[200007];
double calc(int pos, int i) { return -rev[i] * y[stk[pos]] + x[stk[pos]]; }
int main() {
  scanf("%d%d", &n, &K);
  for (int i = 1; i <= n; i++) scanf("%d", &t[i]);
  memset(pre, 0, sizeof(pre));
  memset(sum, 0, sizeof(sum));
  memset(rev, 0, sizeof(rev));
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + 1.0 * t[i];
    rev[i] = rev[i - 1] + 1.0 / (1.0 * t[i]);
    pre[i] = pre[i - 1] + 1.0 * sum[i] / (1.0 * t[i]);
  }
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= n; i++) f[i][1] = pre[i];
  for (int j = 2; j <= K; j++) {
    cnt = 0;
    memset(stk, 0, sizeof(stk));
    for (int i = 0; i <= n; i++) {
      y[i] = sum[i];
      x[i] = f[i][j - 1] - pre[i] + rev[i] * sum[i];
    }
    int pos = 1;
    for (int i = 1; i <= n; i++) {
      while (cnt > 1 &&
             (x[stk[cnt - 1]] - x[stk[cnt]]) * (y[stk[cnt - 1]] - y[i - 1]) >=
                 (x[stk[cnt - 1]] - x[i - 1]) * (y[stk[cnt - 1]] - y[stk[cnt]]))
        --cnt;
      stk[++cnt] = i - 1;
      if (pos > cnt) pos = cnt;
      while (pos < cnt && calc(pos + 1, i) < calc(pos, i)) ++pos;
      f[i][j] = pre[i] + calc(pos, i);
    }
  }
  printf("%.10lf\n", f[n][K]);
  return 0;
}
