#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<ll,ll> pint;

double a[501],sum[501];
double dp[501][501];
int main(){
    int n,m;
    cin>>n>>m;
    rep(i,n) cin>>a[i];
    rep(i,n) sum[i+1]+=a[i]+sum[i];
    rep(i,n)rep(j,n)dp[i][j]=-1000100010;
    dp[0][0]=0;
    rep(i,n)rep(j,m)if(dp[i][j]>=0){
        FOR(k,i,n){
            dp[k+1][j+1]=max(dp[k+1][j+1],dp[i][j]+(sum[k+1]-sum[i])/(k-i+1));
        }
    }
    double mx=0.0;
    FOR(i,1,m+1) mx=max(mx,dp[n][i]);
    cout<<fixed<<setprecision(12)<<mx<<endl;
    return 0;
}
