#include <iostream>
#include <iomanip>//данная библиотека позволяет устанавливать количество знаков после запятой
#include <cmath>//данная библиотеа помогает вычислить min и max
#include <climits>//определяет константы с ограничениями целочисленного типа данных
using namespace std;
int main() {
double n, m;
double x, min = INT_MAX, max = INT_MIN, sum = 0, a = 0, b = 0;
cin >> n >> m;
for (int i = 0; i < m; i++){
for (int j = 0; j < n; j ++){
cin >> x;
if (max == x) a++;
if (max < x) {
if (max != min) sum += a*max;
a = 1;
max = x;
}
if ( min == x) b++;
if (min > x) {
if (max != min) sum += b*min;
b = 1;
min = x;
}
if (x!= min and x != max) sum += x;
}
cout << fixed << setprecision(2) << sum / (n - a - b) << " ";//функция с её аргументом позволяет вывеси результат, округлённый до двух десятичных знаков
sum = a = b = 0;
min = INT_MAX;
max = INT_MIN;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4vL9C00LDQvdC90LDRjyDQsdC40LHQu9C40L7RgtC10LrQsCDQv9C+0LfQstC+0LvRj9C10YIg0YPRgdGC0LDQvdCw0LLQu9C40LLQsNGC0Ywg0LrQvtC70LjRh9C10YHRgtCy0L4g0LfQvdCw0LrQvtCyINC/0L7RgdC70LUg0LfQsNC/0Y/RgtC+0LkgCiNpbmNsdWRlIDxjbWF0aD4vL9C00LDQvdC90LDRjyDQsdC40LHQu9C40L7RgtC10LAg0L/QvtC80L7Qs9Cw0LXRgiDQstGL0YfQuNGB0LvQuNGC0YwgbWluINC4IG1heAojaW5jbHVkZSA8Y2xpbWl0cz4vL9C+0L/RgNC10LTQtdC70Y/QtdGCINC60L7QvdGB0YLQsNC90YLRiyDRgSDQvtCz0YDQsNC90LjRh9C10L3QuNGP0LzQuCDRhtC10LvQvtGH0LjRgdC70LXQvdC90L7Qs9C+INGC0LjQv9CwINC00LDQvdC90YvRhQp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7Cglkb3VibGUgbiwgbTsKCWRvdWJsZSB4LCBtaW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