#include <bits/stdc++.h>
using namespace std;
double cal1[200001];
double cal2[200001];
long long sum[200001];
long long val[200001];
double dp[51][200001];
int stk[200001];
double stat[200001][3];
int stp, nowp;
int n, k;
int main() {
  double inf = 2000000000;
  inf *= inf;
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &val[i]);
  for (int i = 1; i <= n; i++) {
    sum[i] = sum[i - 1] + val[i];
    cal1[i] = cal1[i - 1] + (double)sum[i] / (double)val[i];
    cal2[i] = cal2[i - 1] + 1.0 / val[i];
  }
  for (int i = 1; i <= n; i++) dp[0][i] = inf;
  dp[0][0] = 0;
  for (int j = 1; j <= k; j++) {
    stat[0][0] = 0;
    stp = 1;
    nowp = 0;
    stat[0][1] = -sum[j - 1];
    stat[0][2] = dp[j - 1][j - 1] + sum[j - 1] * cal2[j - 1] - cal1[j - 1];
    for (int i = j; i <= n; i++) {
      while (nowp < stp && stat[nowp][0] < cal2[i]) {
        nowp++;
      }
      nowp--;
      dp[j][i] = stat[nowp][2] + stat[nowp][1] * cal2[i] + cal1[i];
      double islope = -sum[i];
      double iconst = dp[j - 1][i] + sum[i] * cal2[i] - cal1[i];
      double where_cross;
      while (stp > 0) {
        where_cross = (stat[stp - 1][2] - iconst) / (islope - stat[stp - 1][1]);
        if (stat[stp - 1][0] > where_cross) {
          stp--;
          if (nowp == stp) nowp--;
        } else {
          break;
        }
      }
      if (stp == 0) where_cross = 0;
      stat[stp][0] = where_cross;
      stat[stp][1] = islope;
      stat[stp][2] = iconst;
      stp++;
    }
  }
  printf("%.10f", dp[k][n]);
}
