#include <bits/stdc++.h>
using namespace std;
int N = 0, K = 0, le = 0, ri = 0, T[200005] = {};
double recip[200005] = {}, pref[200005] = {}, division[200005] = {};
double dp[2][200005] = {};
struct point {
  double x, y;
  point(double _x = 0, double _y = 0) : x(_x), y(_y) {}
} monoq[200005] = {};
double slape(int ptr) {
  return (monoq[ptr].y - monoq[ptr - 1].y) / (monoq[ptr].x - monoq[ptr - 1].x);
}
int main() {
  scanf("%d%d", &N, &K);
  for (int i = 1; i <= N; i++) scanf("%d", T + i);
  for (int i = 1; i <= N; i++) {
    pref[i] = pref[i - 1] + double(T[i]);
    recip[i] = recip[i - 1] + 1.0 / double(T[i]);
    division[i] = division[i - 1] + pref[i] / double(T[i]);
  }
  for (int i = 1; i <= N; i++) dp[0][i] = division[i];
  int ptr = 0;
  for (int j = 1; j < K; j++) {
    ptr ^= 1;
    le = ri = 0;
    monoq[ri++] = point(0, 0);
    for (int i = 1; i <= N; i++) {
      while (ri > le + 1 && slape(le + 1) < recip[i]) ++le;
      dp[ptr][i] = monoq[le].y - recip[i] * monoq[le].x + division[i];
      monoq[ri++] =
          point(pref[i], dp[ptr ^ 1][i] + pref[i] * recip[i] - division[i]);
      while (ri > le + 2 && slape(ri - 1) <= slape(ri - 2))
        monoq[ri - 2] = monoq[ri - 1], --ri;
    }
  }
  printf("%.10lf\n", dp[ptr][N]);
  return 0;
}
