#include<bits/stdc++.h>
using namespace std;
int q[1200];
int main()
{
int n,m;
double t=-1;
cin>>n>>m;
for(int i=1;i<=n;i++)
{
for(int o=1;o<=m;o++)
{
cin>>q[o];
}
sort(q+1,q+m+1);
double h=0;
for(int o=2;o<m;o++)
h+=q[o];
if(h>t){
t=h;
}
h=0;
}
double c;
c=t/m;
printf("%.2lf",c);
return 0;
}