#include <bits/stdc++.h>
using namespace std;
const long long int INF = 100000000000000LL;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
double s[200005];
double s1[200005];
double is[200005];
double dp[200005][55];
vector<double> A[55];
vector<double> B[55];
int pont[55];
int n, k;
int v[200005];
bool domeioehlixo(int r1, int r2, int r3, int j) {
  return (B[j][r1] - B[j][r3]) * (A[j][r2] - A[j][r1]) <
         (B[j][r1] - B[j][r2]) * (A[j][r3] - A[j][r1]);
}
void add(double a, double b, int j) {
  B[j].push_back(b);
  A[j].push_back(a);
  while (B[j].size() >= 3 and
         domeioehlixo(B[j].size() - 3, B[j].size() - 2, B[j].size() - 1, j)) {
    B[j].erase(B[j].end() - 2);
    A[j].erase(A[j].end() - 2);
  }
}
double query(double isi, int j) {
  if (pont[j] >= B[j].size()) pont[j] = B[j].size() - 1;
  while (pont[j] < B[j].size() - 1 and
         (A[j][pont[j] + 1] * isi + B[j][pont[j] + 1] <
          A[j][pont[j]] * isi + B[j][pont[j]]))
    pont[j]++;
  return A[j][pont[j]] * isi + B[j][pont[j]];
}
int main() {
  ios::sync_with_stdio(false);
  ;
  cin >> n >> k;
  for (int i = 0; i < 200005; i++) {
    for (int j = 0; j < 55; j++) {
      dp[i][j] = 1000000000000000000000.0;
    }
  }
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    s[i] = s[i - 1] + v[i];
    is[i] = is[i - 1] + 1.0 / v[i];
    s1[i] = s[i] / v[i] + s1[i - 1];
  }
  dp[0][1] = 0;
  add(-s[0], dp[0][1] + is[0] * s[0] - s1[0], 1);
  dp[0][0] = 0;
  add(-s[0], dp[0][0] + is[0] * s[0] - s1[0], 0);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= k; j++) {
      dp[i][j] = s1[i] + query(is[i], j - 1);
      dp[i][j] = min(dp[i][j], dp[i][j - 1]);
      add(-s[i], dp[i][j] + is[i] * s[i] - s1[i], j);
    }
  }
  cout << setprecision(12) << fixed;
  cout << dp[n][k] << "\n";
  return 0;
}
