Submission
Status:
PPPPPPPPPPPPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: NovemNotes
Problemset: RANGEandMEAN
Language: cpp
Time: 0.003 second
Submitted On: 2025-10-15 14:28:24
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);cin.tie(NULL);
int n;cin >> n;
int mn=INT_MAX,mx=INT_MIN,sum=0;
for(int i=0;i<n;i++){
int x;cin >> x;
mn=min(mn,x);
mx=max(mx,x);
sum+=x;
}
cout << mx-mn << " ";
cout << fixed << setprecision(2) << (double(sum) / double(n)) << "\n";
return 0;
}