#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int maxn = 5e5 + 4;
const int maxm = 5e1 + 4;
const double pi = acos(-1.0);
double sum[maxn], A[maxn], B[maxn], dp[maxm][maxn], t[maxn];
int n, m, deq[maxn];
double slope(int j, int k, int c) {
  double ret =
      (dp[c][j] - B[j] + sum[j] * A[j]) - (dp[c][k] - B[k] + sum[k] * A[k]);
  return ret / (sum[j] - sum[k]);
}
double getDP(int k, int j, int i) {
  return dp[k][j] + B[i] - B[j] - sum[j] * (A[i] - A[j]);
}
int main() {
  int ik, i, j, k, kase;
  kase = 1;
  while (kase--) {
    scanf("%d%d", &n, &m);
    A[0] = B[0] = sum[0] = 0;
    dp[1][0] = 0;
    for (i = 1; i <= n; ++i) {
      scanf("%lf", t + i);
      sum[i] = sum[i - 1] + t[i];
      A[i] = A[i - 1] + 1 / t[i];
      B[i] = B[i - 1] + sum[i] / t[i];
      dp[1][i] = B[i];
    }
    for (k = 2; k <= m; ++k) {
      int head = 0, tail = -1;
      deq[++tail] = k - 1;
      for (j = k; j <= n; ++j) {
        while (head <= tail - 1 &&
               slope(deq[head + 1], deq[head], k - 1) <= A[j])
          head++;
        dp[k][j] = getDP(k - 1, deq[head], j);
        while (head < tail && slope(deq[tail], deq[tail - 1], k - 1) >
                                  slope(j, deq[tail], k - 1))
          tail--;
        deq[++tail] = j;
      }
    }
    printf("%.5f\n", dp[m][n]);
  }
  return 0;
}
