#include <bits/stdc++.h>
using namespace std;
int val[200010], n, g, opt[52][200010];
double dp[52][200010], prefixAns[200010], prefixSum[200010],
    prefixSumInv[200010];
double cost(int i, int j) {
  assert(j >= i);
  double ret = prefixAns[j];
  if (i > 0)
    ret -= prefixAns[i - 1] +
           prefixSum[i - 1] * (prefixSumInv[j] - prefixSumInv[i - 1]);
  return ret;
}
void solve(int k, int l, int r, int optl, int optr) {
  if (l > r) return;
  double ans = 1e18;
  int mid = (l + r) >> 1;
  if (k == 1)
    ans = cost(mid, n - 1);
  else {
    for (int i = max(mid, optl); i <= optr; i++) {
      if (ans > dp[k - 1][i + 1] + cost(mid, i)) {
        opt[k][mid] = i;
        ans = dp[k - 1][i + 1] + cost(mid, i);
      }
    }
  }
  dp[k][mid] = ans;
  solve(k, l, mid - 1, optl, opt[k][mid]);
  solve(k, mid + 1, r, opt[k][mid], optr);
}
int main() {
  double acc = 0.0;
  scanf("%d %d", &n, &g);
  for (int i = 0; i < n; i++) {
    scanf("%d", &val[i]);
    prefixSum[i] = val[i];
    prefixSumInv[i] = 1.0 / ((double)val[i]);
    if (i > 0) {
      prefixSum[i] += prefixSum[i - 1];
      prefixSumInv[i] += prefixSumInv[i - 1];
    }
  }
  acc = val[0], prefixAns[0] = 1.0;
  for (int i = 1; i < n; i++) {
    prefixAns[i] = prefixAns[i - 1];
    prefixAns[i] += acc / ((double)val[i]) + 1.0;
    acc += (double)val[i];
  }
  for (int k = 1; k <= g; k++) {
    solve(k, 0, n - 1, 0, n - 1);
  }
  printf("%.17f\n", dp[g][0]);
  return 0;
}
