#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, k;
int t[maxn];
double sum[maxn], presum[maxn], subsum[maxn];
struct Line {
  double k, b;
  Line() {}
  Line(double k, double b) : k(k), b(b) {}
  double getval(double x) { return k * x + b; }
};
inline bool better(Line &l1, Line &l2, Line &l3) {
  return (l3.b - l1.b) * (l1.k - l2.k) < (l2.b - l1.b) * (l1.k - l3.k);
}
deque<Line> lis[55];
double dp[maxn][55];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &t[i]);
    sum[i] = sum[i - 1] + 1.0 * t[i];
    presum[i] = presum[i - 1] + sum[i] / (1.0 * t[i]);
    subsum[i] = subsum[i - 1] + 1.0 / (1.0 * t[i]);
  }
  lis[0].push_back(Line(0, 0));
  Line cur, tmp;
  for (int i = 1; i <= n; i++) {
    for (int j = min(i, k); j >= 1; j--) {
      assert(lis[j - 1].size() > 0);
      dp[i][j] = lis[j - 1].front().getval(subsum[i]);
      while (lis[j - 1].size() > 1) {
        cur = lis[j - 1].front();
        lis[j - 1].pop_front();
        if (lis[j - 1].front().getval(subsum[i]) <= dp[i][j])
          dp[i][j] = lis[j - 1].front().getval(subsum[i]);
        else {
          lis[j - 1].push_front(cur);
          break;
        }
      }
      dp[i][j] += presum[i];
      tmp = Line(-sum[i], dp[i][j] - presum[i] + sum[i] * subsum[i]);
      while (lis[j].size() > 1) {
        cur = lis[j].back();
        lis[j].pop_back();
        if (better(lis[j].back(), cur, tmp)) {
        } else {
          lis[j].push_back(cur);
          break;
        }
      }
      lis[j].push_back(tmp);
    }
  }
  printf("%.10lf\n", dp[n][k]);
  return 0;
}
