#include <iostream>
#include <fstream>
#include <string> 
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <functional>
#include <cctype>

#define BIT(a) (1 << (a))

using namespace std;

long long MOD = 1000000007;


long long mod_pow(long long x, long long n){
    long long res = 1;
    for(int i = 0;i < 60; i++){
        if(n >> i & 1) res = res * x % MOD;
        x = x * x % MOD;
    }
    return res;
}

double dp[505][505];
double a[505];

int main(void){
	// input
	int N, M;
	cin >> N >> M;
	for (int i = 1; i <= N; i++){
		cin >> a[i];
	}
	for (int i = 2; i <= N; i++){
		a[i] += a[i-1];
	}

	// dp init
	for (int i = 0; i < 505; i++){
		for (int j = 0; j < 505; j++){
			dp[i][j] = -1;
		}
	}
	for (int i = 1; i <= N; i++){
		dp[i][1] = a[i]/i;
	}

	for (int i = 2; i <= N; i++){
		for (int len = 1; len < i; len++){
			for (int j = 2; j <= i; j++){
				if (dp[i][j] < dp[i-len][j-1] + (a[i] - a[i-len])/(len)){
					dp[i][j] = dp[i-len][j-1] + (a[i] - a[i-len])/(len);
				}
			}
		}
	}
	printf("%f\n", dp[N][M]);
	return 0;
}


