#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
double sum[N], exc[N], rec[N], dp[N][55], a[N];
int q[N];
double getup(int p, int l, int r) {
  return dp[r][p - 1] - dp[l][p - 1] - exc[r] + exc[l] + sum[r] * rec[r] -
         sum[l] * rec[l];
}
double getdown(int l, int r) { return sum[r] - sum[l]; }
double getdp(int p, int i, int l) {
  return dp[l][p - 1] + exc[i] - exc[l] - sum[l] * (rec[i] - rec[l]);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lf", &a[i]);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i];
    rec[i] = rec[i - 1] + 1.0 / a[i];
    exc[i] = exc[i - 1] + 1.0 * sum[i] / a[i];
  }
  for (int i = 1; i <= n; i++) dp[i][1] = exc[i];
  for (int j = 2; j <= k; j++) {
    int head = 0, tail = 0;
    for (int i = 1; i <= n; i++) {
      while (head < tail && getup(j, q[head], q[head + 1]) <=
                                rec[i] * getdown(q[head], q[head + 1]))
        head++;
      dp[i][j] = getdp(j, i, q[head]);
      while (head < tail &&
             getup(j, q[tail], i) * getdown(q[tail - 1], q[tail]) <=
                 getup(j, q[tail - 1], q[tail]) * getdown(q[tail], i))
        tail--;
      q[++tail] = i;
    }
  }
  printf("%.10lf\n", dp[n][k]);
}
