#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  auto *dp = new double[n];
  auto *sum = new double[n];
  auto *pre = new double[n];
  auto *rev = new double[n];
  auto *a = new double[n];
  auto *b = new double[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sum[0] = a[0];
  pre[0] = 1;
  rev[0] = 1 / a[0];
  dp[0] = 1;
  for (int i = 1; i < n; i++) {
    sum[i] = sum[i - 1] + a[i];
    rev[i] = rev[i - 1] + 1 / a[i];
    pre[i] = pre[i - 1] + sum[i] / a[i];
    dp[i] = pre[i];
  }
  for (int q = 2; q <= k; q++) {
    vector<pair<double, double> > lines;
    int p = 2;
    auto intersect = [&lines](int l) {
      return (lines[l].first - lines[l + 1].first) /
             (lines[l + 1].second - lines[l].second);
    };
    auto value = [&lines](int pt, double x) {
      return lines[pt].second * x + lines[pt].first;
    };
    for (int l = q - 2; l < n; l++) {
      b[l] = dp[l] - pre[l] + rev[l] * sum[l];
    }
    for (int r = q - 1; r < n; r++) {
      int l = r - 1;
      if (lines.size() < 2) {
        lines.push_back(make_pair(b[l], -sum[l]));
        if (lines.size() == 1) {
          p = 0;
        } else {
          double inte = intersect(0);
          if (inte <= rev[r]) {
            p = 1;
          } else {
            p = 0;
          }
        }
      } else {
        for (int t = lines.size() - 1; t > 0; t--) {
          double inte = intersect(t - 1);
          if (value(t, inte) < b[l] - sum[l] * inte) {
            break;
          }
          lines.pop_back();
        }
        lines.push_back(make_pair(b[l], -sum[l]));
        if (p >= lines.size() - 1) {
          p = lines.size() - 1;
        } else {
          while (intersect(p) < rev[r] && p < lines.size() - 1) {
            p++;
          }
        }
      }
      dp[r] = pre[r] + value(p, rev[r]);
    }
  }
  cout << dp[n - 1];
  cout << endl;
  return 0;
}
