题目传送门

#include <bits/stdc++.h>

using namespace std;
const int N = 110;
int n, m;
int a[N];
double Max = -1;

int main() {
    cin >> n >> m;
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= m; j++) cin >> a[j];
        sort(a + 1, a + 1 + m);
        double sum = 0;
        for (int j = 2; j <= m - 1; j++) sum += a[j];
        Max = max(Max, sum / (m - 2));
    }
    printf("%.2lf", Max);
    return 0;
}

相关文章:

  • 2021-09-15
  • 2022-12-23
  • 2021-11-19
  • 2021-08-06
  • 2021-12-26
  • 2021-10-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2021-12-03
  • 2021-07-07
  • 2021-12-24
  • 2021-12-22
  • 2021-07-27
  • 2022-12-23
相关资源
相似解决方案