#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

int main() {
	cin >> N >> M;
	vector<long double>v(N + 1);

	for (int i = 1; i <= N; i++) {
		cin >> v[i];
		v[i] += v[i - 1];
	}
	vector<vector<long double>>dp(M + 1, vector<long double>(N + 1));
	for (int i = 1; i <= N; i++) {
		for (int j = 1; j <= M; j++) {
			for (int k = 0; k < i; k++) {
				if (j == 1 && k) {
					continue;
				}
				dp[j][i] = max(dp[j][i], dp[j - 1][k] + (v[i] - v[k]) / (i - k));
			}
		}
	}
	cout << setprecision(15) << dp[M][N] << endl;
	return 0;
}
