#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
const int mod = 1e9 + 7;
int t[N];
double sum[N], sumb[N], sumc[N], f[N][55];
int main() {
  function<void(int, int, int, int, int)> solve = [&](int l, int r, int ql,
                                                      int qr, int k) {
    if (l > r) return;
    int pos = -1, mid = l + r >> 1;
    for (int j = ql; j <= min(mid - 1, qr); j++) {
      double val =
          f[j][k - 1] + (sumb[mid] - sumb[j]) - sum[j] * (sumc[mid] - sumc[j]);
      if (val < f[mid][k]) {
        f[mid][k] = val;
        pos = j;
      }
    }
    solve(l, mid - 1, ql, pos, k);
    solve(mid + 1, r, pos, qr, k);
  };
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &t[i]);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + t[i];
    sumb[i] = sumb[i - 1] + sum[i] / t[i];
    sumc[i] = sumc[i - 1] + 1.0 / 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++) solve(1, n, 0, n - 1, i);
  printf("%.10f\n", f[n][k]);
}
