#include <bits/stdc++.h>
using namespace std;
int n, k, t[200005];
double key[200005];
double revs[200005];
long long s[200005];
double dp[200005][53];
double cost(int L, int R) {
  if (L > R) return 0;
  if (L == R) return 1.0;
  double ret = key[R] - key[L - 1];
  ret -= (revs[R] - revs[L - 1]) * (double)s[L - 1];
  return ret;
}
void go(int L, int R, int le, int ri, int cnt) {
  if (L > R) return;
  int mid = (L + R) >> 1;
  int mn = le;
  int mx = min(ri, mid);
  dp[mid][cnt] = 1e18;
  int opt = -1;
  for (int i = mn; i <= mx; i++) {
    double tmp = dp[i - 1][cnt - 1] + cost(i, mid);
    if (dp[mid][cnt] > tmp) {
      dp[mid][cnt] = tmp;
      opt = i;
    }
  }
  go(L, mid - 1, le, opt, cnt);
  go(mid + 1, R, opt, ri, cnt);
}
int main() {
  scanf("%d %d", &n, &k);
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    sum += t[i];
    key[i] = key[i - 1] + sum / (double)t[i];
    revs[i] = revs[i - 1] + 1.0 / (double)t[i];
    s[i] = sum;
    dp[i][1] = cost(1, i);
  }
  for (int j = 2; j <= k; j++) {
    go(j, n, j, n, j);
  }
  cout << fixed;
  cout.precision(10);
  cout << dp[n][k] << endl;
}
