#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, m, l, r;
int t[maxn], q[maxn];
long long sum[maxn];
double rev[maxn], p[maxn], d[55][maxn];
double up(int t, int k, int j) {
  return d[t][j] - d[t][k] + rev[k] - rev[j] + sum[j] * p[j] - sum[k] * p[k];
}
double down(int k, int j) { return sum[j] - sum[k]; }
int main() {
  cin >> n >> m;
  for (int i = (1); i <= (n); ++i)
    scanf("%d", t + i),
        sum[i] = sum[i - 1] + t[i], p[i] = p[i - 1] + 1.0 / t[i],
        rev[i] = rev[i - 1] + 1.0 * sum[i] / t[i], d[1][i] = rev[i];
  for (int j = (2); j <= (m); ++j) {
    l = r = 0;
    q[r++] = 0;
    for (int i = (1); i <= (n); ++i) {
      while (l + 1 < r &&
             up(j - 1, q[l], q[l + 1]) < p[i] * down(q[l], q[l + 1]))
        ++l;
      int k = q[l];
      d[j][i] = d[j - 1][k] + rev[i] - rev[k] - sum[k] * (p[i] - p[k]);
      while (l + 1 < r && up(j - 1, q[r - 2], q[r - 1]) * down(q[r - 1], i) >=
                              up(j - 1, q[r - 1], i) * down(q[r - 2], q[r - 1]))
        --r;
      q[r++] = i;
    }
  }
  printf("%.8lf\n", d[m][n]);
  return 0;
}
