#include <bits/stdc++.h>
using namespace std;
const long double inf = 1ll << 60;
const int N = 2e5 + 1;
const int K = 50;
long double dp[K][N];
long double arr[N];
long double fun[N];
long double sum[N];
long double rec[N];
int n, k;
long double func(int l, int r) {
  return (fun[r] - fun[l - 1]) - (rec[r] - rec[l - 1]) * sum[l - 1];
}
void calc(int l, int r, int optl, int optr, int i) {
  if (l > r) {
    return;
  }
  pair<long double, int> res = {inf, 0};
  int q = l + r >> 1;
  for (int j = optl; j <= min(q, optr); ++j) {
    res = min(res, {dp[i - 1][j - 1] + func(j, q), j});
  }
  dp[i][q] = res.first;
  calc(l, q - 1, optl, res.second, i);
  calc(q + 1, r, res.second, optr, i);
}
void input() {
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    sum[i] = sum[i - 1] + arr[i];
    rec[i] = rec[i - 1] + 1 / arr[i];
    fun[i] = fun[i - 1] + sum[i] / arr[i];
  }
}
void solve() {
  for (int i = 1; i <= n; ++i) {
    dp[0][i] = fun[i];
  }
  for (int i = 1; i < k; ++i) {
    calc(1, n, 1, n, i);
  }
  cout << fixed << setprecision(10) << dp[k - 1][n] << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  input();
  solve();
}
