#include <bits/stdc++.h>
using namespace std;
const int Max = 2e5 + 10;
const double INF = 1e18;
double dp[2][Max];
bool sw;
double A[Max], ps[Max], ps1[Max], ps2[Max];
double F(int l, int r) {
  return ps1[r] - ps1[l - 1] - ps[l - 1] * (ps2[r] - ps2[l - 1]);
}
void SOLVE(int l, int r, int tl, int tr) {
  if (r == l) return;
  int mid = (l + r) >> 1;
  dp[sw][mid] = INF;
  int opt = -1;
  for (int i = tl; i <= tr; i++)
    if (dp[sw][mid] > dp[!sw][i] + F(i + 1, mid))
      dp[sw][mid] = dp[!sw][i] + F(i + 1, mid), opt = i;
  if (r - l == 1) return;
  SOLVE(l, mid, tl, opt);
  SOLVE(mid, r, opt, tr);
}
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++)
    cin >> A[i], ps[i] = ps[i - 1] + A[i], ps1[i] = ps1[i - 1] + ps[i] / A[i],
                 ps2[i] = ps2[i - 1] + 1 / A[i];
  for (int i = 1; i <= n; i++) dp[sw][i] = F(1, i);
  while (--k) {
    sw = !sw;
    SOLVE(1, n + 1, 1, n);
  }
  cout << dp[sw][n] << '\n';
}
