#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
const int inf = 0x3f3f3f3f;
const long double pi = acos(-1.0);
const string debug_line = "yolo";
const double PI = 4 * atan(1);
double dp[200010][50];
int P[200010][50];
double sum1[200010];
double invsum1[200010];
int a[200010];
double cumsum[200010];
int n, k;
void calc() {
  for (int(i) = (n); (i) > (0); --(i)) {
    sum1[i] = sum1[i + 1] + a[i];
  }
  for (int(i) = (n); (i) > (0); --(i)) {
    invsum1[i] = invsum1[i + 1] + (1.0 / (double)a[i]);
  }
  double temp1 = 0;
  for (int(i) = (n); (i) > (0); --(i)) {
    cumsum[i] = cumsum[i + 1] + (double)a[i] * invsum1[i];
  }
}
double solve(int l, int r) {
  double answer1 = 0;
  answer1 = cumsum[l] - cumsum[r + 1];
  answer1 = answer1 - (sum1[l] - sum1[r + 1]) * invsum1[r + 1];
  return answer1;
}
void fill(int g, int l1, int l2, int p1, int p2) {
  if (l1 > l2) {
    return;
  }
  int lm = (l1 + l2) / 2;
  P[lm][g] = -1;
  dp[lm][g] = 10000000000000000LL * 1.0;
  for (int(k) = (p1); (k) < (min(p2, lm) + 1); ++(k)) {
    double cost1 = dp[k - 1][g - 1] + solve(k, lm);
    if (dp[lm][g] > cost1) {
      dp[lm][g] = cost1;
      P[lm][g] = k;
    }
  }
  if (l2 == l1) {
    return;
  } else {
    fill(g, l1, lm - 1, p1, P[lm][g]);
    fill(g, lm + 1, l2, P[lm][g], p2);
  }
}
int main() {
  scanf("%d%d", &n, &k);
  for (int(i) = (1); (i) < (n + 1); ++(i)) {
    int temp;
    scanf("%d", &temp);
    a[i] = temp;
  }
  calc();
  for (int(l) = (1); (l) < (n + 1); ++(l)) {
    dp[l][1] = solve(1, l);
    P[l][1] = 1;
  }
  for (int(g) = (2); (g) < (k + 1); ++(g)) {
    fill(g, 1, n, 1, n);
  }
  printf("%.10lf\n", dp[n][k]);
  return 0;
}
