#include <bits/stdc++.h>
using namespace std;
const string NAME = "z";
const int N = 202020;
long long n, k, t[N], sum[N];
double dp[52][N], rev[N], pre[N];
struct line {
  long long a;
  double b;
  double val(double x) { return a * x + b; }
  double giaoX(line v) { return (v.b - b) / (a - v.a); }
};
struct convexhull {
  vector<line> dq;
  void insert(line u) {
    while (dq.size() > 1 &&
           dq[dq.size() - 1].giaoX(u) <= dq[dq.size() - 2].giaoX(u))
      dq.pop_back();
    dq.push_back(u);
  }
  double query(double x) {
    int l = 0, r = dq.size() - 1, mid;
    while (l < r) {
      mid = (l + r) >> 1;
      if (dq[mid].val(x) <= dq[mid + 1].val(x))
        r = mid;
      else
        l = mid + 1;
    }
    return dq[r].val(x);
  }
};
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> t[i];
  sum[0] = rev[0] = pre[0] = 0;
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + t[i];
    rev[i] = rev[i - 1] + 1.0 / t[i];
    pre[i] = pre[i - 1] + sum[i] * 1.0 / t[i];
  }
  for (int i = 1; i <= n; i++) dp[1][i] = pre[i];
  for (int K = 2; K <= k; K++) {
    convexhull hull;
    for (int i = K; i <= n; i++) {
      hull.insert((line){-sum[i - 1], dp[K - 1][i - 1] - pre[i - 1] +
                                          sum[i - 1] * rev[i - 1]});
      dp[K][i] = hull.query(rev[i]) + pre[i];
    }
  }
  cout << fixed << setprecision(9) << dp[k][n] << "\n";
  return 0;
}
