#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 1, a = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') x = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    a = a * 10 + ch - '0';
    ch = getchar();
  }
  return x * a;
}
const long long maxn = 2e5 + 10;
const double inf = 1e18 + 7;
long long n, k;
long long sum[maxn], t[maxn], q[maxn];
double sumA[maxn], sumB[maxn], dp[55][maxn];
double slope(long long j1, long long j2, long long p) {
  if (j1 == j2)
    return dp[p][j2] + sum[j2] * sumB[j2] - sumA[j2] >
                   dp[p][j1] + sum[j1] * sumB[j1] - sumA[j1]
               ? inf
               : -inf;
  return (dp[p][j2] + sum[j2] * sumB[j2] - sumA[j2] - dp[p][j1] -
          sum[j1] * sumB[j1] + sumA[j1]) /
         (1.0 * (sum[j2] - sum[j1]));
}
signed main() {
  n = read(), k = read();
  for (long long i = 1; i <= n; i++) t[i] = sum[i] = read();
  for (long long i = 1; i <= n; i++) sum[i] += sum[i - 1];
  for (long long i = 1; i <= n; i++)
    sumA[i] = 1.0 * sum[i] / t[i], sumB[i] = 1.0 / t[i];
  for (long long i = 1; i <= n; i++)
    sumA[i] += sumA[i - 1], sumB[i] += sumB[i - 1];
  for (long long i = 1; i <= n; i++) dp[0][i] = inf;
  for (long long j = 1; j <= k; j++) {
    long long head = 1, tail = 1;
    for (long long i = 1; i <= n; i++) {
      while (head < tail && slope(q[head], q[head + 1], j - 1) < sumB[i])
        head++;
      dp[j][i] = dp[j - 1][q[head]] + sumA[i] - sumA[q[head]] -
                 sum[q[head]] * (sumB[i] - sumB[q[head]]);
      while (head < tail &&
             slope(q[tail - 1], i, j - 1) < slope(q[tail - 1], q[tail], j - 1))
        tail--;
      q[++tail] = i;
    }
  }
  printf("%.12lf", dp[k][n]);
  return 0;
}
