#include <bits/stdc++.h>
template <typename T>
void scanint(T &x) {
  T c = getchar();
  while (((c < 48) || (c > 57)) && (c != '-')) c = getchar();
  bool neg = false;
  if (c == '-') neg = true;
  x = 0;
  for (; c < 48 || c > 57; c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) x = (x * 10) + (c - 48);
  if (neg) x = -x;
}
using namespace std;
const int MAXN = 2e5 + 3, MAXK = 51;
const double INF = 1e30;
double dp[MAXK][MAXN];
double pre[MAXN], t[MAXN], P[MAXN], T[MAXN], cf[MAXN];
int n, k;
void go(int &curr_k, int l, int r, int dyn_l, int dyn_r) {
  if (l > r) return;
  if (dyn_l == dyn_r) {
  }
  int mid = (l + r) >> 1, x = -1, upper = min(dyn_r, mid);
  double val;
  dp[curr_k][mid] = INF;
  for (int i = dyn_l; i <= upper; i++) {
    val = dp[curr_k - 1][i] + P[mid] * (T[mid] - T[i]) - (cf[mid] - cf[i]);
    if (val < dp[curr_k][mid]) {
      dp[curr_k][mid] = val;
      x = i;
    }
  }
  assert(x != -1);
  go(curr_k, l, mid - 1, dyn_l, x);
  go(curr_k, mid + 1, r, x, dyn_r);
}
int main() {
  int x;
  scanint(n), scanint(k);
  for (int i = 1; i <= n; i++) {
    scanint(x), t[i] = x;
    T[i] = T[i - 1] + t[i];
    P[i] = P[i - 1] + (1.0l / t[i]);
    pre[i] = pre[i - 1] + (T[i] / t[i]);
    cf[i] = cf[i - 1] + t[i] * P[i - 1];
  }
  for (int i = 1; i <= n; i++) {
    dp[1][i] = pre[i];
  }
  for (int i = 2; i <= k; i++) {
    go(i, 1, n, 0, n - 1);
  }
  printf("%.6lf\n", dp[k][n]);
  return 0;
}
