#include <bits/stdc++.h>
using namespace std;
inline void file() {
  freopen("P3402_8.in", "r", stdin);
  freopen("data.ans", "w", stdout);
}
char buf[1 << 21], *p1 = buf, *p2 = buf;
inline int getc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  register int ret = 0, f = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ret = ret * 10 + ch - 48;
    ch = getchar();
  }
  return f ? -ret : ret;
}
int n, k, x;
double sum1[200005], sum2[200005], sum3[200005], f[55][200005];
int q[200005], fr, re;
inline double slope(int k, int x, int y) {
  return (double)(f[k][y] + sum1[y] * sum2[y] - sum3[y] - f[k][x] -
                  sum1[x] * sum2[x] + sum3[x]) /
         (double)(sum1[y] - sum1[x]);
}
int main() {
  n = read();
  k = read();
  for (register int i = 1; i <= n; ++i) {
    x = read();
    f[0][i] = (1e15);
    sum1[i] = sum1[i - 1] + x;
    sum2[i] = sum2[i - 1] + (double)1 / (double)x;
    sum3[i] = sum3[i - 1] + (double)sum1[i] / (double)x;
  }
  for (register int i = 1; i <= k; ++i) {
    fr = re = 1;
    for (register int j = 1; j <= n; ++j) {
      while (fr != re && slope(i - 1, q[fr], q[fr + 1]) <= sum2[j]) ++fr;
      const int k = q[fr];
      f[i][j] = f[i - 1][k] + sum3[j] - sum3[k] - sum1[k] * (sum2[j] - sum2[k]);
      while (fr != re &&
             slope(i - 1, q[re - 1], q[re]) >= slope(i - 1, q[re - 1], j))
        --re;
      q[++re] = j;
    }
  }
  printf("%lf", f[k][n]);
  return 0;
}
