Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: RANGEandMEAN
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-15 08:59:08
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(0);
int n; cin >> n;
long long mx = LLONG_MIN;
long long mn = LLONG_MAX;
double sum = 0;
for(int i = 0; i < n; i++) {
long long x; cin >> x;
sum += x;
mx = max(mx, x);
mn = min(mn, x);
}
printf("%lld %.2lf", mx - mn, sum / n);
return 0;
}