#include <bits/stdc++.h>
using namespace std;
const double INF = 10000000000000000;
const long long nr = 2e5 + 100;
inline long long read() {
  long long ret = 0;
  long long x = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') x = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * x;
}
long long n;
long long k;
long long a[nr];
double Sa[nr];
double S[nr];
double SSa[nr];
double S_DAO[nr];
double f[nr][52];
double X(long long j) { return S[j]; }
double Y(long long j, long long T) {
  return f[j][T - 1] - SSa[j] + S_DAO[j] * S[j];
}
double K(long long i) { return S_DAO[i]; }
double slope(long long x, long long y, long long T) {
  return (Y(x, T) - Y(y, T)) / (X(x) - X(y));
}
long long Q[nr];
long long head, tail;
int main() {
  n = read();
  k = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    S[i] = S[i - 1] + a[i];
    Sa[i] = Sa[i - 1] + a[i];
    S_DAO[i] = S_DAO[i - 1] + ((double)1 / (double)a[i]);
  }
  for (int i = 1; i <= n; i++) {
    Sa[i] = Sa[i] * ((double)1 / (double)a[i]);
  }
  for (int i = 1; i <= n; i++) {
    SSa[i] = SSa[i - 1] + Sa[i];
  }
  for (int i = 0; i <= n; i++)
    for (int T = 0; T <= k; T++) f[i][T] = INF;
  f[0][0] = 0;
  for (int T = 1; T <= k; T++) {
    head = tail = 1;
    Q[1] = 0;
    for (int i = 1; i <= n; i++) {
      while (head < tail && slope(Q[head], Q[head + 1], T) <= K(i)) {
        head++;
      }
      long long j = Q[head];
      f[i][T] = f[j][T - 1] + (SSa[i] - SSa[j]) - (S_DAO[i] - S_DAO[j]) * S[j];
      while (head < tail &&
             slope(Q[tail - 1], i, T) <= slope(Q[tail - 1], Q[tail], T)) {
        tail--;
      }
      Q[++tail] = i;
    }
  }
  printf("%.6lf", f[n][k]);
  return 0;
}
