#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return rand(); }
inline int rnd(int x) { return myrand() % x; }
const int inf = (int)1.01e9;
const long double eps = 1e-9;
const long double pi = acos((long double)-1.0);
void precalc() {}
const int maxn = (int)2e5 + 10;
int n, k;
int a[maxn];
int read() {
  if (scanf("%d%d", &n, &k) < 2) {
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  return 1;
}
long double dp[maxn];
long double sum[maxn], sum1[maxn], sum2[maxn];
vector<pair<long double, long double> > st;
long double inter(const pair<long double, long double> &a,
                  const pair<long double, long double> &b) {
  return (a.second - b.second) / (b.first - a.first);
}
void add(long double a, long double b) {
  pair<long double, long double> toadd(a, b);
  while (((int)(st).size()) >= 2 &&
         inter(toadd, st.back()) <=
             inter(st.back(), st[((int)(st).size()) - 2])) {
    st.pop_back();
  }
  st.push_back(toadd);
}
long double get(long double x) {
  assert(((int)(st).size()));
  int left = 0, right = ((int)(st).size());
  while (right - left > 2) {
    int m1 = (left + right) / 2;
    int m2 = m1 + 1;
    assert(m2 < right);
    long double f1 = (x * st[m1].first + st[m1].second);
    long double f2 = (x * st[m2].first + st[m2].second);
    if (f1 < f2) {
      right = m2;
    } else {
      left = m1;
    }
  }
  long double res = 1e18;
  for (int i = left; i < right; ++i) {
    res = min(res, st[i].first * x + st[i].second);
  }
  return res;
}
void solve() {
  sum[0] = sum1[0] = sum2[0] = 0;
  for (int i = 0; i < n; ++i) {
    sum[i + 1] = sum[i] + a[i];
    sum1[i + 1] = sum1[i] + (long double)sum[i + 1] / a[i];
    sum2[i + 1] = sum2[i] + (long double)1 / a[i];
  }
  for (int i = 0; i <= n; ++i) {
    dp[i] = 1e18;
  }
  dp[0] = 0;
  for (int iter = 0; iter < k; ++iter) {
    st.clear();
    for (int i = iter; i <= n; ++i) {
      long double dp0 = dp[i];
      if (i > iter) {
        dp[i] = get(sum2[i]) + sum1[i];
      }
      if (!i || iter) {
        add(-sum[i], sum[i] * sum2[i] + dp0 - sum1[i]);
      }
    }
  }
  printf("%.18f\n", (double)dp[n]);
}
int main() {
  srand(rdtsc());
  precalc();
  while (1) {
    if (!read()) {
      break;
    }
    solve();
  }
  return 0;
}
