#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
int n, m;
int sco[110] = { 0, };
double tot;
int cou,min,max;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
{
tot = 0,cou = 0,min=0,max=0;
for (int j = 0; j < n; j++)
scanf("%d", &sco[j]);
sort(sco + 1, sco + n);
for (int j = 1; j < n; j++)
{
if (sco[j] >= 0 && sco[j] <= m)
{
if (min)
{
tot += sco[j];
cou++;
max = sco[j];
}
min = 1;
}
}
tot -= max;
cou--;
tot /= cou;
tot = (tot + sco[0]) / 2;
printf("%d\n", (int)(tot+0.5));
}
system("pause");
return 0;
}