#include <bits/stdc++.h>
using namespace std;
using ld = long double;
vector<ld> pre, sum, rec;
ld C(int j, int i) { return pre[i] - pre[j] - sum[j] * (rec[i] - rec[j]); }
vector<ld> dp, ndp;
void solve(int l, int r, int optl, int optr) {
  if (l > r) return;
  int mid = (l + r) / 2;
  pair<ld, int> best{LDBL_MAX, -1};
  for (int k = optl; k <= min(mid, optr); ++k) {
    best = min(best, {dp[k] + C(k, mid), k});
  }
  ndp[mid] = best.first;
  int opt = best.second;
  solve(l, mid - 1, optl, opt);
  solve(mid + 1, r, opt, optr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(6);
  int n, k;
  cin >> n >> k;
  vector<ld> v(n + 1);
  for (int i = 1; i < n + 1; ++i) {
    cin >> v[i];
  }
  pre.resize(n + 1);
  sum.resize(n + 1);
  rec.resize(n + 1);
  dp.resize(n + 1);
  ndp.resize(n + 1);
  ld cursum = 0;
  for (int i = 1; i < n + 1; ++i) {
    cursum += v[i];
    pre[i] = pre[i - 1] + cursum / v[i];
  }
  for (int i = 1; i < n + 1; ++i) {
    sum[i] = sum[i - 1] + v[i];
  }
  for (int i = 1; i < n + 1; ++i) {
    rec[i] = rec[i - 1] + 1 / v[i];
  }
  dp = pre;
  for (int i = 1; i < k; ++i) {
    solve(1, n, 1, n);
    swap(dp, ndp);
  }
  cout << dp[n] << '\n';
  return 0;
}
