#include <bits/stdc++.h>
int N, K;
long long S[200001];
double IS[200001], f[200001], g[200001], O;
inline double Dist(int u, int v) { return (f[u] - f[v]) / (S[v] - S[u]); }
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1, x; i <= N; i++) {
    scanf("%d", &x);
    S[i] = S[i - 1] + x;
    IS[i] = IS[i - 1] + 1.0 / x;
    O += (double)S[i] / x;
  }
  for (int i = 1; i <= N; i++) f[i] = -1e30;
  while (K--) {
    static int q[200001];
    int H = 1, T = 0;
    for (int i = 0; i <= N; i++) f[i] -= S[i] * IS[i];
    for (int i = 0; i <= N; i++) {
      while (H < T &&
             f[q[H]] + S[q[H]] * IS[i] <= f[q[H + 1]] + S[q[H + 1]] * IS[i])
        H++;
      g[i] = H <= T ? f[q[H]] + S[q[H]] * IS[i] : -1e30;
      while (H < T && Dist(q[T - 1], q[T]) >= Dist(q[T], i)) T--;
      q[++T] = i;
    }
    std::copy(g, g + N + 1, f);
  }
  printf("%.10lf\n", O - g[N]);
  return 0;
}
