#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 + 233;
int a[maxn];
double f[maxn], g[maxn], inv[maxn], sum = 0, invs = 0, ans = 0;
int l = 1, r = 1;
inline double cost(int L, int R) {
  while (l > L) {
    l--;
    sum += a[l], invs += inv[l];
    ans += invs * a[l];
  }
  while (l < L) {
    ans -= invs * a[l];
    sum -= a[l], invs -= inv[l];
    l++;
  }
  while (r < R) {
    r++;
    sum += a[r];
    invs += inv[r];
    ans += sum * inv[r];
  }
  while (r > R) {
    ans -= sum * inv[r];
    sum -= a[r];
    invs -= inv[r];
    r--;
  }
  return ans;
}
void divide(int l, int r, int pl, int pr) {
  if (l > r) return;
  int mid = (l + r) >> 1;
  int pm = pl;
  for (int i = pl; i <= pr; i++) {
    if (i > mid) break;
    double buf = g[i - 1] + cost(i, mid);
    if (buf < f[mid]) {
      f[mid] = buf;
      pm = i;
    }
  }
  divide(l, mid - 1, pl, pm);
  divide(mid + 1, r, pm, pr);
  return;
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    inv[i] = 1.0 / a[i];
  }
  l = 1, r = 1;
  sum = a[1];
  invs = inv[1];
  ans = 1;
  cost(1, 2);
  f[0] = 0;
  for (int i = 1; i <= n; i++) f[i] = 1LL << 60;
  while (k--) {
    for (int i = 0; i <= n; i++) {
      g[i] = f[i];
      f[i] = 1LL << 60;
    }
    divide(1, n, 1, n);
  }
  printf("%.5f\n", f[n]);
  return 0;
}
