Submission
Status:
--------------------
Subtask/Task Score:
0/100
Score: 0
User: angpangSK
Problemset: RANGEandMEAN
Language: cpp
Time: 0.003 second
Submitted On: 2025-09-24 20:26:29
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int n;
cin >> n;
long long min = 2e9;
long long max = -2e9;
long long mean = 0;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
if (x < min) {
min = x;
}
if (x > max) {
max = x;
}
mean += x/n;
}
long long range = max - min;
cout << range << " ";
cout << fixed << setprecision(2) << mean;
return 0;
}