Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: tl.cpp
Problemset: RANGEandMEAN
Language: cpp
Time: 0.002 second
Submitted On: 2026-08-05 14:02:28
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
double long sum;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> n;
int mn = INT_MAX, mx = INT_MIN;
for (int i = 0; i < n; i++) {
int x; cin >> x;
mn = min(mn, x);
mx = max(mx, x);
sum += x;
}
cout << mx - mn << ' ' << fixed << setprecision(2) << sum / n;
}