#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int n, k, t[maxn];
long long st[maxn];
double p[maxn], sp[maxn], f[maxn][51];
double get(int l, int r) {
  return p[r] - p[l - 1] - (sp[r] - sp[l - 1]) * st[l - 1];
}
bool minimize(double &a, double b) {
  if (a < b) return false;
  a = b;
  return true;
}
void func(int l, int r, int k, int u, int v) {
  int mid = (l + r) >> 1, last = u;
  for (int i = u; i <= min(mid - 1, v); ++i) {
    if (minimize(f[mid][k], get(i + 1, mid) + f[i][k - 1])) last = i;
  }
  if (l < mid) func(l, mid - 1, k, u, last);
  if (mid < r) func(mid + 1, r, k, last, v);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &t[i]);
  for (int i = 1; i <= n; ++i) {
    st[i] = st[i - 1] + t[i];
    p[i] = p[i - 1] + (double)st[i] / t[i];
    sp[i] = sp[i - 1] + (double)1 / t[i];
  }
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= k; ++j) f[i][j] = 1e18;
  f[0][0] = 0;
  for (int i = 1; i <= k; ++i) func(1, n, i, 0, n);
  printf("%.4f", f[n][k]);
  return 0;
}
