#include <bits/stdc++.h>
using namespace std;
int const maxn = 2e5 + 5, maxk = 55;
int t[maxn];
long double dp[maxk][maxn];
long double inf = 1e18;
long double pref[maxn], rev[maxn];
int ptr, good = 0;
pair<long double, long double> lines[maxn];
inline long double inter(pair<long double, long double> s1,
                         pair<long double, long double> s2) {
  long double g = (s1.second - s2.second) / (s2.first - s1.first);
  return g;
}
inline void add(long double k, long double b) {
  while (ptr >= 2 && inter(lines[ptr - 1], lines[ptr - 2]) >=
                         inter(lines[ptr - 1], {k, b})) {
    ptr--;
  }
  lines[ptr++] = {k, b};
}
inline long double get(long double x) {
  good = min(good, ptr - 1);
  while (good + 1 < ptr && inter(lines[good], lines[good + 1]) <= x) good++;
  while (good > 0 && inter(lines[good], lines[good - 1]) > x) good--;
  return lines[good].first * x + lines[good].second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> t[i];
  for (int i = 1; i <= n; ++i)
    dp[0][i] = inf, pref[i] = pref[i - 1] + t[i],
    rev[i] = rev[i - 1] + 1 / (long double)t[i];
  for (int i = 1; i <= k; ++i) {
    ptr = 0, good = 0;
    for (int j = 1; j <= n; ++j) {
      add(-pref[j - 1], pref[j - 1] * rev[j - 1] + dp[i - 1][j - 1]);
      dp[i][j] = get(rev[j]);
    }
  }
  long double sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += pref[i] / (long double)t[i];
  }
  cout << fixed << setprecision(9) << dp[k][n] + sum << '\n';
  return 0;
}
