#include <bits/stdc++.h>
int n, m, x;
long double b[200005], c[200005], s[200005];
long double f[2][200005];
void solve(int l, int r, int auxL, int auxR);
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    s[i] = (long double)x + s[i - 1];
    b[i] = s[i] / (long double)x + b[i - 1];
    c[i] = 1.0 / (long double)x + c[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    f[0][i] = (long double)1e110;
  }
  x = 1;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j <= n; j++) f[x][j] = (long double)1e110;
    solve(1, n, 0, n);
    if (i == m) printf("%.12lf\n", (double)f[x][n]);
    x ^= 1;
  }
  return 0;
}
void solve(int l, int r, int auxL, int auxR) {
  int meio = (l + r) / 2;
  int auxM = 0;
  long double g = (long double)1e110;
  for (int i = auxL; i <= auxR && i < meio; i++) {
    long double aux = f[x ^ 1][i] + b[meio] - b[i] - s[i] * (c[meio] - c[i]);
    if (aux < g) {
      g = aux;
      auxM = i;
    }
  }
  f[x][meio] = g;
  if (l < meio) solve(l, meio - 1, auxL, auxM);
  if (r > meio) solve(meio + 1, r, auxM, auxR);
}
