#include <bits/stdc++.h>
using namespace std;
int n, k;
int arr[200020];
double sum[200020], invSum[200020];
double cost[200020];
double dp[200020][51];
double getCost(int i, int j) {
  double ans = cost[i] - cost[j + 1] -
               (sum[j] - sum[i] + arr[i]) * (invSum[n - 1] - invSum[j]);
  return ans;
}
void compute(int reg, int l, int r, int optL = 0, int optR = n) {
  if (l > r) return;
  int mid = (l + r) >> 1;
  double& res = dp[mid][reg];
  double ans = 1e100;
  int bound = -1;
  for (int i = max(optL, mid + 1); i <= optR; i++) {
    double temp = dp[i][reg - 1] + getCost(mid, i - 1);
    if (temp < res) {
      res = temp;
      bound = i;
    }
  }
  if (res > 1e100) res = 1e100;
  if (bound != -1) {
    compute(reg, l, mid - 1, optL, bound);
    compute(reg, mid + 1, r, bound, optR);
  } else {
    compute(reg, l, mid - 1, optL, optR);
    compute(reg, mid + 1, r, optL, optR);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> arr[i];
  double ss = 0, iss = 0;
  for (int i = 0; i < n; i++) {
    sum[i] = ss + arr[i];
    ss += arr[i];
    invSum[i] = iss + 1.00 / arr[i];
    iss = iss + 1.00 / arr[i];
  }
  ss = 0;
  for (int i = n - 1; i >= 0; i--) {
    cost[i] = ss + arr[i] * (invSum[n - 1] - invSum[i] + 1.00 / arr[i]);
    ss = ss + arr[i] * (invSum[n - 1] - invSum[i] + 1.00 / arr[i]);
  }
  for (int i = 0; i < 200020; i++)
    for (int j = 0; j < 51; j++) dp[i][j] = 1e100;
  dp[n][0] = 0.0;
  for (int regionsLeft = 1; regionsLeft <= k; regionsLeft++) {
    compute(regionsLeft, 0, n - 1);
  }
  cout << fixed;
  cout << setprecision(9) << dp[0][k];
  return 0;
}
