#include <bits/stdc++.h>
using namespace std;
double dp[55][200005], pre[200005], t[200005];
double sum[200005];
int a[200005], q[200005];
int n, k, fnt, rar;
inline double slope(int k, int j1, int j2) {
  return (dp[k - 1][j1] - pre[j1] + sum[j1] * 1.0 * t[j1] - dp[k - 1][j2] +
          pre[j2] - sum[j2] * 1.0 * t[j2]) /
         ((sum[j1] - sum[j2]) * 1.0);
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= n; j++) dp[i][j] = 1e50;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    sum[i] = sum[i - 1] + 1.0 * a[i];
    t[i] = t[i - 1] + 1.0 / (a[i] * 1.0);
    dp[1][i] = pre[i] = pre[i - 1] + sum[i] / (a[i] * 1.0);
  }
  for (int i = 2; i <= k; i++) {
    fnt = 0;
    rar = -1;
    for (int j = 1; j <= n; j++) {
      while (fnt < rar && slope(i, q[fnt], q[fnt + 1]) < t[j]) fnt++;
      dp[i][j] = dp[i - 1][q[fnt]] + pre[j] - pre[q[fnt]] -
                 sum[q[fnt]] * 1.0 * (t[j] - t[q[fnt]]);
      while (rar > fnt && slope(i, q[rar - 1], q[rar]) > slope(i, q[rar], j))
        rar--;
      q[++rar] = j;
    }
  }
  printf("%lf\n", dp[k][n]);
  return 0;
}
