#include <bits/stdc++.h>
using namespace std;
long double t[200000 + 10];
long double sum[200000 + 10];
long double sumx[200000 + 10];
long double ans[55][200000 + 10];
void find(int k, int l, int r, int ol, int or1) {
  if (r < l) return;
  int m = (l + r) / 2;
  int opt = min(m, or1);
  if (m < k)
    ans[k][m] = 1e100;
  else {
    double nans;
    double sum1 = 0.0;
    double an = 1e100;
    for (int i = opt; i >= ol; i--) {
      if (i - 1)
        nans = ans[k - 1][i - 1] + ans[1][m] - ans[1][i - 1] -
               (sumx[i - 1] - sumx[0]) * (sum[m] - sum[i - 1]);
      else
        nans = 1e100;
      if (nans < an) {
        an = nans, opt = i;
      }
    }
    ans[k][m] = an;
  }
  find(k, l, m - 1, ol, opt);
  find(k, m + 1, r, opt, or1);
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> t[i];
  if (k == n) {
    cout << n << endl;
    return 0;
  }
  double sum1 = 0;
  sum[0] = 0.0;
  sumx[0] = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] += sum[i - 1] + 1.0 / (double)t[i], sumx[i] = sumx[i - 1] + t[i];
  }
  for (int i = 1; i <= n; i++) {
    sum1 += t[i];
    ans[1][i] = ans[1][i - 1] + (double)sum1 / (double)t[i];
  }
  ans[1][0] = 1e100;
  for (int i = 2; i <= k; i++) {
    ans[i][0] = 1e100;
    find(i, 1, n, 1, n);
  }
  cout << setprecision(9) << fixed << ans[k][n] << endl;
  return 0;
}
