#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>

using namespace std;

const int SIZE = 510;

double dp[SIZE][SIZE];

int main(){
  int n,m;
  int a[SIZE];
  long long sum[SIZE];
  
  scanf("%d%d",&n,&m);

  sum[0] = 0;

  for(int i=0;i<n;i++){
    scanf("%d",a+i);
    sum[i+1] = a[i] + sum[i];  
  }

  for(int i=0;i<=n;i++){
    for(int j=0;j<=n;j++){
      dp[i][j] = -1e18;
    }
  }

  dp[0][0] = 0;

  double ans = 0;
  
  for(int i=0;i<m;i++){
    for(int j=0;j<=n;j++){
      for(int k=j+1;k<=n;k++){
        dp[i+1][k] = max(dp[i+1][k], dp[i][j] + (double)(sum[k] - sum[j]) / (k-j));
      }
    }
  }

  for(int i=0;i<m;i++){
    ans = max(dp[i+1][n], ans);
  }
  
  printf("%.10lf\n",ans);
  
  return 0;
}
  


