#include <bits/stdc++.h>
const int MAX_N = (int)2e5 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
int n, k;
double dp[55][MAX_N];
int a[MAX_N];
double pref[MAX_N], rev[MAX_N];
long long sum[MAX_N];
struct Line {
  double k, b;
  Line() {}
  Line(double k, double b) : k(k), b(b) {}
  double what(double x) { return k * x + b; }
};
vector<Line> st;
int ptr;
void clear() {
  st.clear();
  ptr = 0;
}
double itr(Line x, Line y) { return (y.b - x.b) / (x.k - y.k); }
void add(Line x) {
  while (int((st).size()) > 1 && itr(x, st[int((st).size()) - 2]) <=
                                     itr(st.back(), st[int((st).size()) - 2]))
    st.pop_back();
  st.push_back(x);
}
double get(double x) {
  ptr = min(ptr, int((st).size()) - 1);
  while (ptr + 1 < int((st).size()) && st[ptr + 1].what(x) <= st[ptr].what(x))
    ptr++;
  return st[ptr].what(x);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + a[i];
    pref[i] = pref[i - 1] + 1.0 * sum[i] / a[i];
    rev[i] = rev[i - 1] + 1.0 / a[i];
  }
  for (int it = 1; it <= k; it++) {
    clear();
    for (int i = it; i <= n; i++) {
      if (it == 1) {
        dp[it][i] = pref[i];
        continue;
      }
      add(Line((-1.0 * sum[i - 1]),
               dp[it - 1][i - 1] - pref[i - 1] + rev[i - 1] * sum[i - 1]));
      dp[it][i] = get(rev[i]) + pref[i];
    }
  }
  printf("%.10f", dp[k][n]);
  return 0;
}
