#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 500;
const double eps = 1e-8;
const double inf = 1e23333;
int N, K, t[maxn], rk, q[maxn];
double dp[maxn][52], prefixA[maxn], prefixB[maxn], sum[maxn];
double except(int l, int r) {
  return 1 + prefixA[r] - prefixA[l] - sum[l - 1] * (prefixB[r] - prefixB[l]);
}
double cal_b(int i) { return dp[i][rk] + prefixA[i - 1]; }
inline double slope(int l, int r) {
  double s1 = cal_b(r) - cal_b(l);
  double s2 = prefixB[r - 1] - prefixB[l - 1];
  return s1 / s2;
}
int main(int argc, char *argv[]) {
  scanf("%d%d", &N, &K);
  for (int i = 0; i <= N; ++i)
    for (int j = 0; j <= K; ++j) dp[i][j] = inf;
  for (int i = 1; i <= N; ++i) {
    scanf("%d", t + i);
    sum[i] = sum[i - 1] + t[i];
    prefixA[i] = prefixA[i - 1] + (double)sum[i] / (double)(t[i]);
    prefixB[i] = prefixB[i - 1] + (double)1.0 / (double)(t[i]);
  }
  for (int i = 1; i <= N; ++i) dp[i][K] = except(i, N);
  for (int j = K - 1; j >= 1; --j) {
    rk = j + 1;
    int front = 0, rear = 0;
    q[rear++] = N - (K - j) + 1;
    for (int i = N - (K - j); i >= 1; --i) {
      double extra = -prefixA[i] + sum[i - 1] * prefixB[i] + 1;
      while (rear - front > 1 &&
             slope(q[front], q[front + 1]) >= (double)sum[i - 1])
        front++;
      int best = q[front];
      dp[i][j] = dp[best][j + 1] + except(i, best - 1);
      while (rear - front > 1 &&
             slope(q[rear - 2], q[rear - 1]) <= slope(q[rear - 1], i))
        rear--;
      q[rear++] = i;
    }
  }
  printf("%.10lf\n", dp[1][1]);
  return 0;
}
