Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Kei
Problemset: RANGEandMEAN
Language: cpp
Time: 0.005 second
Submitted On: 2026-10-08 16:29:52
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
void solve(){
int k,range;
double tmean=0.00;
cin >> k;
vector<int> v(k);
for(int& x : v){
cin >> x;
tmean+=x;
}
sort(v.begin(),v.end());
range = v[k-1]-v[0];
tmean/=k;
cout << range << ' ';
cout << fixed << setprecision(2) << tmean;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}