#include <bits/stdc++.h>
using namespace std;
const int MaxN = 2e5;
int n, K, p[MaxN + 5];
double t[MaxN + 5], S[MaxN + 5];
double Sdt[MaxN + 5], Odt[MaxN + 5];
double g[MaxN + 5][51];
double seq[MaxN + 5][51];
int head[60], tail[60];
void Init() {
  for (int i = 1; i <= 51; i++) head[i] = 1;
  for (int i = 1; i <= 51; i++) tail[i] = 0;
  S[0] = Sdt[0] = Odt[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%lf", &t[i]);
    S[i] = S[i - 1] + t[i];
    Sdt[i] = Sdt[i - 1] + S[i - 1] / t[i];
    Odt[i] = Odt[i - 1] + 1.0 / t[i];
  }
}
double Cov(int x, int y, int k) { return (g[y][k] - g[x][k]) / (S[y] - S[x]); }
void Insert(int x, int k) {
  while (tail[k] > head[k] && Cov(seq[tail[k] - 1][k], seq[tail[k]][k], k) >=
                                  Cov(seq[tail[k]][k], x, k))
    tail[k]--;
  seq[++tail[k]][k] = x;
}
void Solve() {
  for (int i = 1; i <= n; i++) {
    g[i][1] = S[i] * Odt[i];
    Insert(i, 1);
    for (int k = 2; k <= min(K, i); k++) {
      while (head[k - 1] < tail[k - 1] &&
             Cov(seq[head[k - 1]][k - 1], seq[head[k - 1] + 1][k - 1], k - 1) <=
                 Odt[i])
        head[k - 1]++;
      int op = seq[head[k - 1]][k - 1];
      g[i][k] = g[op][k - 1] - S[op] * Odt[i] + S[i] * Odt[i];
      Insert(i, k);
    }
  }
  printf("%.9lf\n", g[n][K] + Sdt[n] - S[n] * Odt[n] + n);
}
int main() {
  while (~scanf("%d%d", &n, &K)) {
    Init();
    Solve();
  }
}
