#include <iostream>
#include <iomanip>
using namespace std;
int main() {
cout << fixed << setprecision(2);
int n, m, tmp, sumGl, sumMin, sumMax, valMin, valMax, countMin, countMax;
cin >> n >> m;
for(int j = 0 ; j < m ; j++){
sumGl = sumMin = sumMax = 0;
valMin = 11;
valMax = 0;
countMin = countMax = 0;
for(int i = 0 ; i < n; i++) {
cin >> tmp;
sumGl += tmp;
if(tmp < valMin) {
sumMin = tmp;
valMin = tmp;
countMin = 1;
}
else if(tmp == valMin) {
sumMin += tmp;
countMin++;
}
if(tmp > valMax) {
sumMax = tmp;
valMax =tmp;
countMax = 1;
}
else if(tmp == valMax) {
sumMax += tmp;
countMax++;
}
}
cout << (sumGl - sumMax - sumMin) / (double)(n - countMax - countMin) << " ";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8aW9tYW5pcD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkgewoJY291dCA8PCBmaXhlZCA8PCBzZXRwcmVjaXNpb24oMik7CglpbnQgbiwgbSwgdG1wLCBzdW1HbCwgc3VtTWluLCBzdW1NYXgsIHZhbE1pbiwgdmFsTWF4LCBjb3VudE1pbiwgY291bnRNYXg7CgljaW4gPj4gbiA+PiBtOwoJZm9yKGludCBqID0gMCA7IGogPCBtIDsgaisrKXsKCQlzdW1HbCA9IHN1bU1pbiA9IHN1bU1heCA9IDA7CgkJdmFsTWluID0gMTE7CgkJdmFsTWF4ID0gMDsKCQljb3VudE1pbiA9IGNvdW50TWF4ID0gMDsKCQlmb3IoaW50IGkgPSAwIDsgaSA8IG47IGkrKykgewoJCQljaW4gPj4gdG1wOwoJCQlzdW1HbCArPSB0bXA7CgkJCWlmKHRtcCA8IHZhbE1pbikgewoJCQkJc3VtTWluID0gdG1wOwoJCQkJdmFsTWluID0gdG1wOwoJCQkJY291bnRNaW4gPSAxOwoJCQl9CgkJCWVsc2UgaWYodG1wID09IHZhbE1pbikgewoJCQkJc3VtTWluICs9IHRtcDsKCQkJCWNvdW50TWluKys7CgkJCX0KCQkJaWYodG1wID4gdmFsTWF4KSB7CgkJCQlzdW1NYXggPSB0bXA7CgkJCQl2YWxNYXggPXRtcDsKCQkJCWNvdW50TWF4ID0gMTsKCQkJfQoJCQllbHNlIGlmKHRtcCA9PSB2YWxNYXgpIHsKCQkJCXN1bU1heCArPSB0bXA7CgkJCQljb3VudE1heCsrOwoJCQl9CgkJfQoJCWNvdXQgPDwgKHN1bUdsIC0gc3VtTWF4IC0gc3VtTWluKSAvIChkb3VibGUpKG4gLSBjb3VudE1heCAtIGNvdW50TWluKSA8PCAiICI7Cgl9CglyZXR1cm4gMDsKfQ==