#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)2e5 + 42;
const int MAXK = 57;
const double inf = 1e17 + 42;
int n, k;
int a[MAXN];
void read() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
}
double dp[MAXN][MAXK], c;
double answer[MAXN], rev_sum[MAXN], sum[MAXN];
inline double cost(int l, int r) {
  return (answer[r] - answer[l - 1]) -
         (rev_sum[r] - rev_sum[l - 1]) * sum[l - 1];
}
void rec(int l, int r, int opt_l, int opt_r, int ck) {
  if (r < l) return;
  int mid = (l + r) >> 1, copt = -1, to = min(mid, opt_r);
  dp[mid][ck] = inf;
  for (int i = to; i >= opt_l; i--) {
    c = cost(i, mid);
    if (dp[mid][ck] > dp[i - 1][ck - 1] + c) {
      dp[mid][ck] = c + dp[i - 1][ck - 1];
      copt = i;
    }
  }
  rec(l, mid - 1, opt_l, copt, ck);
  rec(mid + 1, r, copt, opt_r, ck);
}
void solve() {
  for (int i = 1; i <= n; i++) {
    rev_sum[i] = rev_sum[i - 1] + 1.0 / a[i];
    sum[i] = sum[i - 1] + a[i];
    answer[i] = answer[i - 1] + sum[i] * (1.0 / a[i]);
  }
  dp[0][0] = 0;
  for (int i = 1; i <= n; i++) dp[i][0] = inf;
  for (int i = 1; i <= k; i++) rec(1, n, 1, n, i);
  cout << setprecision(9) << fixed << dp[n][k] << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  read();
  solve();
  return 0;
}
