#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const long double INF = 1e18;
int n, K, t[N];
long double a[N], ra[N], c[N], dp[N], pd[N];
inline long double getCost(int l, int r) {
  return ra[r] * (a[r] - a[l - 1]) - (c[r] - c[l - 1]);
}
void dfs(int l, int r, int optL, int optR) {
  if (l > r) return;
  int z = (l + r) >> 1, opt = optL;
  for (int k = (optL); k < (min(optR, z - 1) + 1); ++k) {
    long double tmp = pd[k] + getCost(k + 1, z);
    if (dp[z] > tmp) dp[z] = tmp, opt = k;
  }
  dfs(l, z - 1, optL, opt);
  dfs(z + 1, r, opt, optR);
}
long double solve() {
  for (int i = (0); i < (n + 1); ++i) dp[i] = !i ? 0 : INF;
  for (int i = (1); i < (K + 1); ++i) {
    for (int j = (0); j < (n + 1); ++j) pd[j] = dp[j], dp[j] = INF;
    dfs(1, n, 0, n);
  }
  return dp[n];
}
int main() {
  scanf("%d%d", &n, &K);
  for (int i = (1); i < (n + 1); ++i) {
    scanf("%d", t + i);
    a[i] = a[i - 1] + t[i];
    ra[i] = ra[i - 1] + 1.0 / t[i];
    c[i] = c[i - 1] + t[i] * ra[i - 1];
  }
  printf("%.10f\n", (double)solve());
  return 0;
}
