Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Nuttykub

Problemset: RANGEandMEAN

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-01 22:09:05

#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<double> vec;
    double total = 0;
    for (int i = 0;i < n;i++){
        double a;
        cin >> a;
        total += a;
        vec.push_back(a);
    }
    sort(vec.begin(),vec.end());
    cout << vec[n-1]-vec[0] << " ";
    cout << fixed << setprecision(2) << total/n;
}