#include <bits/stdc++.h>
using namespace std;
int N, K;
double ARR[200010];
double DP[51][200010];
double SUM_DEN[200010];
double SUM[200010];
double ALL[200010];
double get(int i, int j) {
  double a = ALL[j];
  if (i > 0) {
    a -= ALL[i - 1];
    a -= SUM[i - 1] * (SUM_DEN[j] - SUM_DEN[i - 1]);
  }
  return a;
}
void dcdp(int i, int L, int H, int oL, int oH) {
  int O = oL;
  int M = (L + H) / 2;
  double b = get(oL, M) + DP[i - 1][oL - 1];
  for (int j = oL; j <= oH; ++j) {
    double t = get(j, M) + DP[i - 1][j - 1];
    if (t < b) {
      O = j;
      b = t;
    }
  }
  DP[i][M] = b;
  if (L < M) dcdp(i, L, M - 1, oL, O);
  if (M < H) dcdp(i, M + 1, H, O, oH);
}
struct ConvexHullTrick {
  struct Line {
    double m, b;
    Line(double m, double b) : m(m), b(b) {}
    double inter(const Line &L) const { return (L.b - b) / (m - L.m); }
    double eval(double x) { return m * x + b; }
  };
  vector<Line> V;
  vector<double> X;
  int C;
  ConvexHullTrick() : C(0){};
  void add(Line l) {
    while (V.size() >= 2) {
      if (V[V.size() - 2].inter(l) < X.back()) {
        V.pop_back();
        X.pop_back();
      } else
        break;
    }
    if (V.size() >= 1) {
      X.push_back(V.back().inter(l));
    }
    V.push_back(l);
    C = min(C, (int)X.size());
  }
  double eval(double x) {
    while (C < X.size() && x > X[C]) C++;
    return V[C].eval(x);
    int p = lower_bound(X.begin(), X.end(), x) - X.begin();
    return V[p].eval(x);
  }
};
void cht(int i, int N) {
  ConvexHullTrick CT;
  ConvexHullTrick::Line line(
      -SUM[i - 1], SUM[i - 1] * SUM_DEN[i - 1] - ALL[i - 1] + DP[i - 1][i - 1]);
  CT.add(line);
  for (int j = i; j < N; ++j) {
    if (i == j)
      DP[i][j] = i + 1;
    else {
      DP[i][j] = ALL[j] + CT.eval(SUM_DEN[j]);
    }
    ConvexHullTrick::Line line(-SUM[j],
                               SUM[j] * SUM_DEN[j] - ALL[j] + DP[i - 1][j]);
    CT.add(line);
  }
}
int main() {
  cin >> N >> K;
  for (int i = 0; i < N; ++i) {
    cin >> ARR[i];
  }
  for (int i = 0; i < N; ++i) {
    SUM[i] = ARR[i];
    SUM_DEN[i] = 1 / ARR[i];
    if (i > 0) {
      SUM[i] += SUM[i - 1];
      SUM_DEN[i] += SUM_DEN[i - 1];
    }
    ALL[i] = SUM[i] / ARR[i];
    if (i) ALL[i] += ALL[i - 1];
  }
  for (int i = 0; i < N; ++i) {
    DP[0][i] = get(0, i);
  }
  for (int i = 1; i < K; ++i) {
    cht(i, N);
  }
  printf("%0.12lf\n", DP[K - 1][N - 1]);
}
