#include <bits/stdc++.h>
double dp[200001][51], inv[200001];
int n, k, a[200001], q[200001], l, r, j;
long long s[200001];
double slope(int p, int q) {
  return (dp[q][j - 1] - dp[p][j - 1]) / (s[q] - s[p]);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i)
    scanf("%d", a + i), s[i] = s[i - 1] + a[i], inv[i] = inv[i - 1] + 1. / a[i];
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= k; ++j) dp[i][j] = -1e18;
  dp[0][0] = 0;
  for (j = 1; j < k; ++j) {
    for (int i = 1; i <= n; ++i) {
      while (l < r && slope(q[l], q[l + 1]) > inv[n] - inv[i]) ++l;
      dp[i][j] = dp[q[l]][j - 1] + (s[i] - s[q[l]]) * (inv[n] - inv[i]);
      while (l < r && slope(q[r - 1], q[r]) < slope(q[r], i)) --r;
      q[++r] = i;
    }
    l = r = 0;
  }
  double ans = 0, res = 0;
  for (int i = 1; i < n; ++i)
    ans += 1. * s[i] / a[i],
        res = ((res) > (dp[i][k - 1]) ? (res) : (dp[i][k - 1]));
  ans += 1. * s[n] / a[n];
  printf("%.10lf\n", ans - res);
  return 0;
}
