0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 18:12:04 +00:00
OI-codes/Luogu/P5738/P5738.cpp

43 lines
756 B
C++
Raw Normal View History

// R38743182
#include <bits/stdc++.h>
using namespace std;
struct node {
2021-11-19 09:01:13 +00:00
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() {
2021-11-19 09:01:13 +00:00
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;
}