Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: punzacp555
Problemset: RANGEandMEAN
Language: cpp
Time: 0.003 second
Submitted On: 2026-09-29 22:07:28
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
float sum = 0, fn = n;
long long mn = LLONG_MAX, mx = LLONG_MIN;
while(n--) {
long long x;
cin >> x;
mn = min(mn, x);
mx = max(mx, x);
sum += x;
}
cout << mx-mn << ' ' << fixed << setprecision(2) << sum / fn;
return 0;
}