#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double llINF = (1e18) + 100;
const int MAXN = 2e5 + 10;
int n, m, t[MAXN];
double rev[MAXN], sum[MAXN], pre[MAXN];
double dp_before[MAXN], dp_cur[MAXN];
void compute(int l, int r, int optl, int optr) {
  if (l > r) return;
  int mid = (l + r) >> 1;
  int opt = 1;
  double vmid = llINF, aux;
  for (int k = optl; k <= min(mid, optr); k++) {
    aux = pre[mid] - pre[k - 1] - sum[k - 1] * (rev[mid] - rev[k - 1]);
    if (vmid > dp_before[k - 1] + aux) {
      vmid = dp_before[k - 1] + aux;
      opt = k;
    }
  }
  dp_cur[mid] = vmid;
  compute(l, mid - 1, optl, opt);
  compute(mid + 1, r, opt, optr);
}
double pd() {
  for (int i = 1; i <= n; i++) dp_cur[i] = pre[i];
  dp_cur[0] = llINF;
  for (int i = 1; i < m; i++) {
    for (int j = 0; j <= n; j++) dp_before[j] = dp_cur[j];
    compute(1, n, 1, n);
  }
  return dp_cur[n];
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> t[i];
  for (int i = 1; i <= n; i++) {
    rev[i] = rev[i - 1] + 1 / ((double)t[i]);
    sum[i] = sum[i - 1] + (double)t[i];
    pre[i] = pre[i - 1] + sum[i] / ((double)t[i]);
  }
  cout << setprecision(9) << fixed;
  cout << pd() << '\n';
}
