#include <bits/stdc++.h>
using namespace std;
const int NMAX = 200000;
const double INF = 1e18;
int N, K;
int t[NMAX + 2];
long long prefixSum[NMAX + 2];
double inverseSum[NMAX + 2], suffixSum[NMAX + 2];
double dp[2][NMAX + 2];
double Cost(int L, int R) {
  if (L > R) {
    return INF;
  }
  return suffixSum[L] - suffixSum[R + 1] -
         (prefixSum[R] - prefixSum[L - 1]) * inverseSum[R + 1];
}
void Solve(int lvl, int st, int dr, int optSt, int optDr) {
  if (st > dr) {
    return;
  }
  int mid = (st + dr) >> 1;
  dp[lvl][mid] = INF;
  int opt = optSt;
  for (int i = optSt; i <= min(optDr, mid); i++) {
    if (dp[!lvl][i] + Cost(i + 1, mid) < dp[lvl][mid]) {
      opt = i;
      dp[lvl][mid] = dp[!lvl][i] + Cost(i + 1, mid);
    }
  }
  Solve(lvl, st, mid - 1, optSt, opt);
  Solve(lvl, mid + 1, dr, opt, optDr);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> N >> K;
  for (int i = 1; i <= N; i++) {
    cin >> t[i];
  }
  for (int i = 1; i <= N; i++) {
    prefixSum[i] = prefixSum[i - 1] + t[i];
  }
  for (int i = N; i >= 1; i--) {
    inverseSum[i] = inverseSum[i + 1] + 1.0 / (1.0 * t[i]);
  }
  for (int i = N; i >= 1; i--) {
    suffixSum[i] = suffixSum[i + 1] + t[i] * inverseSum[i];
  }
  for (int i = 1; i <= N; i++) {
    dp[1][i] = Cost(1, i);
  }
  for (int k = 2; k <= K; k++) {
    Solve(k & 1, 1, N, 0, N);
  }
  cout << fixed << setprecision(10) << dp[K & 1][N] << '\n';
  return 0;
}
