#include <bits/stdc++.h>
using namespace std;
int n, m;
double dp[200020][55];
int tim[200020];
double c1[200020];
double c2[200020];
double c3[200020];
double cc[200020];
inline double a(int x) { return c1[x]; }
inline double b(int x) { return c2[x]; }
inline double sum(int x) { return b(x); }
inline double g(int x, int y) { return (cc[y] - cc[x]) / (a(y) - a(x)); }
inline double calc(int le, int ri) {
  return (c3[ri] - c3[le]) - c1[le] * (c2[ri] - c2[le]);
}
const double eps = 1e-10;
int q[200020], ll, rr;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &tim[i]);
    c1[i] = c1[i - 1];
    c2[i] = c2[i - 1];
    c3[i] = c3[i - 1];
    c1[i] += (double)tim[i];
    c2[i] += (double)(1.0 / tim[i]);
    c3[i] += c1[i] / ((double)tim[i]);
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= m; j++) {
      dp[i][j] = 1e100;
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = i - 1; j <= n; j++) {
      cc[j] = dp[j][i - 1] - c3[j] + c1[j] * c2[j];
    }
    ll = 1;
    rr = 2;
    q[1] = i - 1;
    for (int j = i; j <= n; j++) {
      while (rr - ll > 1 && g(q[ll], q[ll + 1]) < sum(j)) ll++;
      dp[j][i] = dp[q[ll]][i - 1] + calc(q[ll], j);
      while (rr - ll > 1 && g(q[rr - 1], j) < g(q[rr - 2], q[rr - 1])) rr--;
      q[rr] = j;
      rr++;
    }
  }
  printf("%.20lf\n", dp[n][m]);
  return 0;
}
