#include <bits/stdc++.h>
using namespace std;
long double DP[200001][51];
long double W[200001];
long long int pref[200001];
int tablica[200001];
long double expected[200001];
long double sumy(int a, int b) {
  long long int suma = pref[a - 1];
  long double x = expected[b] - expected[a - 1];
  long double y = W[b] - W[a - 1];
  return x - (long double)suma * y;
}
void funkcja(int p, int k, int level, int lewy, int prawy) {
  if (p == k) {
    for (int i = lewy; i <= prawy; i++) {
      long double suma;
      suma = sumy(i + 1, (p + k) / 2);
      if (DP[(p + k) / 2][level] == 0 ||
          DP[(p + k) / 2][level] > DP[i][level - 1] + suma) {
        DP[(p + k) / 2][level] = DP[i][level - 1] + suma;
      }
    }
    return;
  }
  int x;
  for (int i = lewy; i <= prawy; i++) {
    long double suma = sumy(i + 1, (p + k) / 2);
    if (DP[(p + k) / 2][level] == 0 ||
        DP[(p + k) / 2][level] > DP[i][level - 1] + suma) {
      DP[(p + k) / 2][level] = DP[i][level - 1] + suma;
      x = i;
    }
  }
  funkcja(p, (p + k) / 2, level, lewy, x);
  funkcja((p + k) / 2 + 1, k, level, x, prawy);
}
int main() {
  ios::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  long long int suma = 0;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    suma += a;
    tablica[i] = a;
    DP[i][1] = DP[i - 1][1] + (long double)suma / a;
    W[i] = W[i - 1] + (long double)1.0 / (long double)a;
    pref[i] = pref[i - 1] + a;
    expected[i] = expected[i - 1] + (long double)suma / a;
  }
  for (int i = 2; i <= k; i++) {
    funkcja(1, n, i, 1, n);
  }
  cout.precision(7);
  cout << fixed << DP[n][k];
  return 0;
}
