0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-27 22:31:58 +00:00
OI-codes/problem/P5738/P5738.cpp
2020-09-22 20:23:46 +08:00

43 lines
760 B
C++

// R38743182
#include <bits/stdc++.h>
using namespace std;
struct node {
int score[22];
double sum, all;
node() {
memset(this->score, 0x00, sizeof(this->score));
all = sum = 0.00;
}
void t(int m) {
for (int i = 0; i < m; i++) {
cin >> score[i];
}
std::sort(score, score + m);
for (int i = 1; i + 1 < m; i++) {
sum += score[i];
}
all = sum / (m - 2.00);
}
};
bool cmp(node a, node b) {
return a.all > b.all;
}
int main() {
int n, m;
node student[105];
cin >> n >> m;
for (int i = 0; i < n; i++) {
student[i].t(m);
}
sort(student, student + n, cmp);
printf("%.2lf", student[0].all);
return 0;
}