#include <bits/stdc++.h>
using namespace std;
inline int ReadInt() {
  static int n, ch;
  n = 0, ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) n = (n << 1) + (n << 3) + ch - '0', ch = getchar();
  return n;
}
const int maxn = 200000 + 3;
const double INF = 1e300;
int n, k;
double rev[maxn], pre[maxn], dp[2][maxn], sum[maxn], *f, *nowF, ans = INF;
inline double y(int i) { return f[i] - pre[i] + rev[i] * sum[i]; }
inline double T(int i, int j) { return (y(j) - y(i)) / (sum[j] - sum[i]); }
int main() {
  n = ReadInt(), k = ReadInt();
  sum[0] = 0, rev[0] = 0.0;
  for (int i = 1; i <= n; ++i) {
    int t = ReadInt();
    sum[i] = sum[i - 1] + t;
    rev[i] = rev[i - 1] + 1.0 / t;
    pre[i] = pre[i - 1] + 1.0 * sum[i] / t;
  }
  f = *dp, nowF = *(dp + 1);
  fill(f, f + n + 1, INF);
  f[0] = 0;
  int q[maxn], l, r;
  for (int x = 0; x < k; ++x) {
    nowF[0] = INF;
    l = 0, r = 0;
    for (int i = 0; i < n; ++i) {
      while (r - l >= 2 && T(q[r - 2], q[r - 1]) > T(q[r - 1], i)) r--;
      q[r++] = i;
      while (r - l >= 2 && T(q[l], q[l + 1]) < rev[i + 1]) l++;
      int j = q[l];
      nowF[i + 1] = f[j] + pre[i + 1] - pre[j] - (rev[i + 1] - rev[j]) * sum[j];
    }
    ans = min(ans, nowF[n]);
    swap(f, nowF);
  }
  printf("%.10lf\n", ans);
  return 0;
}
