#include <bits/stdc++.h>
using namespace std;
long long int inf = 1000000000ll * +200;
long long int mod = 998244353;
const int maxn = 2e5 + 200;
int n, k;
long double E[maxn], t[maxn], psum[maxn], dp[52][maxn], invpsum[maxn];
;
;
;
;
inline long double gtexp(int l, int r) {
  if (l > r) return 0;
  if (l == 1) return E[r];
  long double res =
      E[r] - E[l - 1] - (invpsum[r] - invpsum[l - 1]) * psum[l - 1];
  return res;
}
void dpcalc(int l, int r, int optl, int optr, int i) {
  if (r - l <= 1) {
    dp[i][l] = inf;
    for (int j = optl; j <= optr; j++) {
      if (j > l) continue;
      dp[i][l] = min(dp[i][l], dp[i - 1][j] + gtexp(j + 2, l + 1));
    }
    return;
  }
  int mid = (l + r) >> 1;
  int optmid = optl;
  for (int j = optl; j <= optr; j++) {
    if (j > mid) continue;
    if (dp[i - 1][j] + gtexp(j + 2, mid + 1) <
        dp[i - 1][optmid] + gtexp(optmid + 2, mid + 1)) {
      optmid = j;
    }
  }
  dpcalc(l, mid, optl, optmid, i);
  dpcalc(mid, r, optmid, optr, i);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    psum[i] = psum[i - 1] + t[i];
    invpsum[i] = invpsum[i - 1] + (1 / t[i]);
  }
  E[0] = 0;
  for (int i = 1; i <= n; i++) {
    if (i == 1) {
      E[i] = 1;
      continue;
    }
    E[i] = E[i - 1] + psum[i] / t[i];
  }
  for (int i = 0; i < n; i++) {
    dp[1][i] = E[i + 1];
  }
  for (int i = 2; i <= k; i++) {
    dpcalc(0, n, 0, n - 1, i);
  }
  cout << setprecision(10) << fixed;
  cout << dp[k][n - 1];
  return 0;
}
