#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int K = 55;
long long ps[N], n, k;
double sp[N], dp[N][K];
void solve(int j, int l = 1, int r = n, int s = 1, int e = n) {
  if (r < l) return;
  int m = (l + r) >> 1, md = s;
  double t;
  for (int i = s; i <= min(e, m); i++) {
    t = dp[i - 1][j - 1] + (dp[m][1] - dp[i - 1][1]) -
        (ps[i - 1] * (sp[m] - sp[i - 1]));
    md = (t < dp[m][j] ? i : md);
    dp[m][j] = min(dp[m][j], t);
  }
  solve(j, l, m - 1, s, md);
  solve(j, m + 1, r, md, e);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> ps[i], sp[i] = sp[i - 1] + 1.0 / ps[i], ps[i] += ps[i - 1];
  for (int i = 0; i < N; i++)
    for (int j = 0; j < K; j++) dp[i][j] = 1e18;
  dp[0][1] = 0;
  for (int i = 1; i <= n; i++)
    dp[i][1] = dp[i - 1][1] + ps[i] / (ps[i] - ps[i - 1] + 0.0);
  for (int j = 2; j <= k; j++) solve(j);
  cout << fixed << setprecision(10) << dp[n][k];
  return 0;
}
