#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
double s1[N], s2[N], s3[N];
double dp[55][N];
int n, a[N], q[N];
template <class T>
void read(T &first) {
  char ch;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-';) ch = getchar();
  first = 0;
  int t = 1;
  if (ch == '-') {
    ch = getchar();
    t = -1;
  }
  for (; ch >= '0' && ch <= '9'; ch = getchar()) first = first * 10 + ch - '0';
  first *= t;
}
double calc(int k, int l, int r) {
  return dp[k][l] + s3[r] - s3[l] - (s2[r] - s2[l]) * s1[l];
}
double slack(int k, int first, int second) {
  return ((dp[k][second] - s3[second]) -
          (dp[k][first] - s3[first] - s1[first] * (s2[second] - s2[first]))) /
             (s1[second] - s1[first]) +
         s2[second];
}
int main() {
  int k;
  read(n);
  read(k);
  for (int i = 1; i <= n; i++) read(a[i]);
  s1[0] = 0;
  for (int i = 1; i <= n; i++) s1[i] = s1[i - 1] + a[i];
  s2[0] = 0;
  for (int i = 1; i <= n; i++) s2[i] = s2[i - 1] + 1.0 / a[i];
  s3[0] = 0;
  for (int i = 1; i <= n; i++) s3[i] = s3[i - 1] + s1[i] / a[i];
  for (int i = 1; i <= n; i++) dp[1][i] = s3[i];
  for (int j = 2; j <= k; j++) {
    int f = 1, r = 1;
    q[1] = j - 1;
    for (int i = j; i <= n; i++) {
      while (f < r && calc(j - 1, q[f], i) >= calc(j - 1, q[f + 1], i)) f++;
      dp[j][i] = calc(j - 1, q[f], i);
      while (f < r && slack(j - 1, q[r - 1], q[r]) >= slack(j - 1, q[r], i))
        r--;
      q[++r] = i;
    }
  }
  printf("%.10lf\n", dp[k][n]);
  return 0;
}
