#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 9;
const int MAXK = 55;
const double INF = 1e18;
long long t[MAXN];
double sum[MAXN];
double inv[MAXN];
double e[MAXN];
double dp[MAXK][MAXN];
double licz(int a, int b) {
  double ret = e[b];
  ret -= e[a - 1];
  ret -= sum[a - 1] * (inv[b] - inv[a - 1]);
  return ret;
}
void DaC(int k, int a, int b, int pocz, int kon) {
  if (a > b) return;
  if (a == b) {
    for (long long i = pocz; i <= (min(kon, a - 1)); ++i)
      dp[k][a] = min(dp[k][a], dp[k - 1][i] + licz(i + 1, a));
    return;
  }
  int mid = a + b;
  mid /= 2;
  int num = -1;
  for (long long i = pocz; i <= (min(kon, mid - 1)); ++i) {
    if (dp[k][mid] > dp[k - 1][i] + licz(i + 1, mid)) {
      num = i;
      dp[k][mid] = dp[k - 1][i] + licz(i + 1, mid);
    }
  }
  if (num == -1)
    DaC(k, mid + 1, b, pocz, kon);
  else {
    DaC(k, a, mid - 1, pocz, num);
    DaC(k, mid + 1, b, num, kon);
  }
}
int main() {
  int n, k;
  cin >> n >> k;
  for (long long i = 0; i < (n); ++i) scanf("%lld", &t[i + 1]);
  for (long long i = 1; i <= (n); ++i) {
    sum[i] = sum[i - 1] + t[i];
    inv[i] = inv[i - 1] + ((double)1 / (double)t[i]);
    e[i] = e[i - 1] + (sum[i] / (double)t[i]);
  }
  for (long long i = 0; i < (k + 1); ++i)
    for (long long j = 0; j < (n + 1); ++j) dp[i][j] = INF;
  dp[0][0] = 0;
  for (long long i = 1; i <= (k); ++i) {
    DaC(i, i, n, i - 1, n - 1);
  }
  cout << fixed;
  cout.precision(6);
  cout << dp[k][n] << endl;
  return 0;
}
