#include <bits/stdc++.h>
using namespace std;
const int MK = 55;
const int MN = 200500;
int N, K;
vector<int> T;
vector<double> sum, rev, pre;
vector<vector<double> > dp;
struct line {
  double a, b;
  line(double a = 0, double b = 0) : a(a), b(b) {}
};
double cross(line x, line y) { return (y.b - x.b) / (x.a - y.a); }
namespace CHT {
line lines[MN];
int l, r;
void clear() { l = r = 0; }
void push(double a, double b) {
  lines[r] = line(a, b);
  while (l + 1 < r &&
         cross(lines[r - 2], lines[r]) > cross(lines[r - 1], lines[r])) {
    lines[r - 1] = lines[r];
    r--;
  }
  r++;
}
long double get(double x) {
  while (l + 1 < r && cross(lines[l], lines[l + 1]) <= x) l++;
  return lines[l].a * x + lines[l].b;
}
};  // namespace CHT
int main() {
  scanf("%d %d", &N, &K);
  T.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &T[i]);
  }
  sum = rev = pre = vector<double>(N);
  for (int i = 0; i < N; i++) {
    sum[i] = T[i];
    if (i != 0) sum[i] += sum[i - 1];
    rev[i] = (double)1.0 / T[i];
    pre[i] = sum[i] / T[i];
    if (i != 0) {
      rev[i] += rev[i - 1];
      pre[i] += pre[i - 1];
    }
  }
  dp = vector<vector<double> >(K, vector<double>(N));
  for (int i = 0; i < N; i++) {
    dp[0][i] = pre[i];
  }
  for (int k = 1; k < K; k++) {
    CHT::clear();
    for (int i = 0; i < N; i++) {
      dp[k][i] = pre[i] - CHT::get(rev[i]);
      CHT::push(sum[i], -dp[k - 1][i] + pre[i] - rev[i] * sum[i]);
    }
  }
  printf("%.25f", dp[K - 1][N - 1]);
}
