#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
using namespace std;
const long long MAXN = 200 * 1000 + 23, MAXK = 50 + 2;
long long n, k, t[MAXN], ps[MAXN];
long double dp[MAXK][MAXN], cs[MAXN], sc[MAXN];
void f(long long z, long long l, long long r = n + 1, long long ll = 0,
       long long rr = n) {
  long long mid = ((l + r) >> 1), md = -1;
  long double hp =
      sc[mid] - sc[min(mid - 1, rr - 1)] -
      ps[min(mid - 1, rr - 1)] * (cs[mid] - cs[min(mid - 1, rr - 1)]);
  for (long long i = min(mid - 1, rr - 1); i >= ll;) {
    if (dp[z][mid] > dp[z - 1][i] + hp) {
      dp[z][mid] = dp[z - 1][i] + hp;
      md = i;
    }
    i--;
    if (i < ll) break;
    hp += (cs[mid] - cs[i]) * t[i];
  }
  if (l < mid) f(z, l, mid, ll, md + 1);
  if (mid + 1 < r) f(z, mid + 1, r, md, rr);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) {
    cin >> t[i];
    cs[i + 1] = cs[i] + 1. / t[i];
    ps[i + 1] = ps[i] + t[i];
    sc[i + 1] = sc[i] + 1. * ps[i + 1] / t[i];
  }
  for (long long i = 1; i <= n; i++) dp[0][i] = LLONG_MAX >> 2;
  for (long long i = 1; i <= k; i++) {
    for (long long j = 1; j <= n; j++) dp[i][j] = LLONG_MAX >> 2;
    f(i, i);
  }
  cout << dp[k][n];
  return 0;
}
