#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 201000;
double sum[maxn], rev[maxn], con[maxn];
int a[maxn];
double dp[maxn][55];
int dep[maxn];
double getup(int id, int y, int x) {
  double ans1 = dp[y][id - 1] - con[y] + sum[y] * rev[y];
  double ans2 = dp[x][id - 1] - con[x] + sum[x] * rev[x];
  return ans1 - ans2;
}
double getdown(int y, int x) { return sum[y] - sum[x]; }
double getdp(int id, int x, int y) {
  return dp[x][id - 1] + con[y] - con[x] - sum[x] * (rev[y] - rev[x]);
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  sum[0] = rev[0] = con[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] + a[i];
    rev[i] = rev[i - 1] + 1. / a[i];
    con[i] = con[i - 1] + sum[i] / a[i];
  }
  for (int i = 1; i <= n; i++) dp[i][1] = con[i];
  int head, tail;
  for (int i = 2; i <= k; i++) {
    head = tail = 0;
    dep[tail++] = i - 1;
    for (int j = i; j <= n; j++) {
      while (head < tail - 1 && getup(i, dep[head + 1], dep[head]) <=
                                    getdown(dep[head + 1], dep[head]) * rev[j])
        head++;
      int k = dep[head];
      dp[j][i] = dp[k][i - 1] + con[j] - con[k] - sum[k] * (rev[j] - rev[k]);
      while (head < tail - 1 && getup(i, dep[tail - 1], dep[tail - 2]) *
                                        getdown(j, dep[tail - 2]) >=
                                    getup(i, j, dep[tail - 2]) *
                                        getdown(dep[tail - 1], dep[tail - 2]))
        tail--;
      dep[tail++] = j;
    }
  }
  printf("%.10lf\n", dp[n][k]);
  return 0;
}
