#include <bits/stdc++.h>
using namespace std;
const double oo = 1e100;
int n, k;
int ts[200000];
double sum[200000 + 1];
double rev[200000 + 1];
double pre[200000 + 1];
double dp[50 + 1][200000 + 1];
template <typename T>
struct line {
  T a, b;
  line() {}
  line(T a, T b) : a(a), b(b) {}
  T eval(T x) { return a * x + b; }
};
template <typename T>
struct CHT {
  int s;
  int t;
  vector<line<T> > deq;
  CHT(int n) {
    deq = vector<line<T> >(n);
    clear();
  }
  void clear() { s = t = 0; }
  bool check(const line<T> &l1, const line<T> &l2, const line<T> &l3) {
    return (l2.a - l1.a) * (l3.b - l2.b) >= (l2.b - l1.b) * (l3.a - l2.a);
  }
  void push(T a, T b) {
    line<T> l(a, b);
    while (s + 1 < t && check(deq[t - 2], deq[t - 1], l)) --t;
    deq[t++] = l;
  }
  T get(T x) {
    while (s + 1 < t && deq[s].eval(x) >= deq[s + 1].eval(x)) ++s;
    return deq[s].eval(x);
  }
};
void solve() {
  for (int i = 0; i < (int)(n); i++) sum[i + 1] = sum[i] + ts[i];
  for (int i = 0; i < (int)(n); i++) rev[i + 1] = rev[i] + 1.0 / ts[i];
  for (int i = 0; i < (int)(n); i++) pre[i + 1] = pre[i] + sum[i + 1] / ts[i];
  for (int i = 0; i < (int)(k + 1); i++)
    for (int j = 0; j < (int)(n + 1); j++) dp[i][j] = oo;
  dp[0][0] = 0.0;
  CHT<double> cht(n + 1);
  for (int i = 0; i < (int)(k); i++) {
    cht.clear();
    for (int j = 0; j < (int)(n); j++) {
      cht.push(-sum[j], dp[i][j] - pre[j] + rev[j] * sum[j]);
      double tmp = pre[j + 1] + cht.get(rev[j + 1]);
      dp[i + 1][j + 1] = min(dp[i + 1][j + 1], tmp);
    }
  }
}
int main() {
  scanf(" %d %d", &n, &k);
  for (int i = 0; i < (int)(n); i++) scanf(" %d", ts + i);
  solve();
  printf("%.9lf\n", dp[k][n]);
  return 0;
}
