#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int K = 55;
const double inf = 1e18;
int n, k, opt[K][N], t[N];
long long sum[N];
double dp[K][N], val[N], f[N];
double cost(int l, int r) {
  return val[r] - val[l - 1] - (sum[l - 1] * (f[r] - f[l - 1]));
}
void calc(int lev, int l, int r, int L, int R) {
  if (l > r) return;
  int mid = (l + r) / 2;
  dp[lev][mid] = inf;
  for (int i = L; i <= min(R, mid - 1); i++) {
    if (dp[lev][mid] > dp[lev - 1][i] + cost(i + 1, mid)) {
      opt[lev][mid] = i;
      dp[lev][mid] = dp[lev - 1][i] + cost(i + 1, mid);
    }
  }
  calc(lev, l, mid - 1, L, opt[lev][mid]);
  calc(lev, mid + 1, r, opt[lev][mid], R);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> t[i];
    sum[i] = sum[i - 1] + t[i];
    val[i] = val[i - 1] + 1.0 * sum[i] / t[i];
    f[i] = f[i - 1] + 1.0 / t[i];
  }
  for (int i = 1; i <= n; i++) dp[1][i] = val[i];
  for (int lev = 2; lev <= k; lev++) calc(lev, 1, n, 0, n - 1);
  cout << fixed << setprecision(7) << dp[k][n];
}
