#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int maxn = 2e5 + 5;
const int maxk = 55;
namespace Convex {
struct Line {
  double k, b;
  Line() {}
  Line(double k, double b) : k(k), b(b) {}
  inline double func(double x) { return k * x + b; }
} stk[maxn];
int tp;
inline void init() { tp = -1; }
inline double cross(Line l1, Line l2) { return (l2.b - l1.b) / (l1.k - l2.k); }
inline void add(Line l) {
  for (; tp && cross(stk[tp - 1], l) < cross(stk[tp - 1], stk[tp]); --tp)
    ;
  stk[++tp] = l;
  return;
}
}  // namespace Convex
int n, k;
double t[maxn], sum[maxn], f[maxn], g[maxn];
double dp[maxn][maxk];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = (1); i <= (n); ++i) {
    scanf("%lf", t + i);
    sum[i] = sum[i - 1] + t[i];
    f[i] = f[i - 1] + sum[i] / t[i];
    g[i] = g[i - 1] + 1 / t[i];
  }
  dp[0][0] = 0;
  for (int j = (1); j <= (k); ++j) {
    int ptr = 0;
    Convex::init();
    if (j == 1) Convex::add(Convex::Line(0, 0));
    for (int i = (j); i <= (n); ++i) {
      Convex::add(Convex::Line(
          -sum[i - 1], sum[i - 1] * g[i - 1] - f[i - 1] + dp[i - 1][j - 1]));
      for (ptr = (ptr > Convex::tp) ? (Convex::tp) : (ptr);
           ptr + 1 <= Convex::tp &&
           g[i] >= Convex::cross(Convex::stk[ptr], Convex::stk[ptr + 1]);
           ++ptr)
        ;
      dp[i][j] = Convex::stk[ptr].func(g[i]) + f[i];
    }
  }
  printf("%.10lf\n", dp[n][k]);
  return 0;
}
