#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long mpe(long long base, long long exponent, long long modulus) {
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = result * base % modulus;
    exponent = exponent >> 1;
    base = base * base % modulus;
  }
  return result;
}
long long arr[200005], sum[200005];
double dbl[200005], pre[200005];
double an[52][200005];
double cost(long long i, long long j) {
  double res = pre[j] - pre[i - 1] - ((dbl[j] - dbl[i - 1]) * (sum[i - 1]));
  return res;
}
void compute(int k, int l, int r, int opl, int opr) {
  if (l == r) {
    an[k][l] = 10000000000000000;
    int kwi = opl;
    while (kwi <= opr && kwi < r) {
      an[k][l] = min(an[k - 1][kwi] + cost(kwi + 1, r), an[k][l]);
      kwi++;
    }
    return;
  }
  int mid = (l + r) / 2, opv = opl, kwi = opl;
  an[k][mid] = 10000000000000000;
  for (kwi = opl; kwi <= opr && kwi < mid; kwi++) {
    if (an[k - 1][kwi] + cost(kwi + 1, mid) < an[k][mid]) {
      an[k][mid] = an[k - 1][kwi] + cost(kwi + 1, mid);
      opv = kwi;
    }
  }
  if (mid - 1 >= l) compute(k, l, mid - 1, opl, opv);
  if (mid + 1 <= r) compute(k, mid + 1, r, opv, opr);
}
int main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; ++i) cin >> arr[i + 1];
  dbl[0] = 0.00000000000000;
  sum[0] = 0;
  for (long long i = 1; i < n + 1; ++i) {
    dbl[i] = dbl[i - 1] + (1.0 / (1.0 * arr[i]));
    sum[i] = sum[i - 1] + arr[i];
    pre[i] = pre[i - 1] + (sum[i] / (1.0 * arr[i]));
  }
  for (long long i = 1; i < n + 1; ++i) {
    an[0][i] = 10000000000000;
    an[1][i] = cost(1, i);
  }
  for (long long i = 2; i < k + 1; ++i) compute(i, 1, n, i - 1, n - 1);
  printf("%0.7lf", an[k][n]);
  return 0;
}
