Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: ssens3
Problemset: RANGEandMEAN
Language: cpp
Time: 0.002 second
Submitted On: 2026-10-05 08:07:37
#include <iostream>
#include <algorithm>
#include <iomanip>
using namespace std;
int main(){
int n, x, m = 0, mx = -1e9-7, mn = 1e9+7; cin >> n;
for (int i = 0; i < n; i++){
cin >> x; m += x;
mn = min(mn, x); mx = max(mx, x);
}
cout << mx-mn << " " << fixed << setprecision(2) << float(m)/n;
}