Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: mik

Problemset: RANGEandMEAN

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-11 14:11:02

#include <bits/stdc++.h>

using namespace std;

int main(){
    ios_base::sync_with_stdio(false),cin.tie(NULL);
    int n;
    long long sum=0;
    long long mn=INT_MAX,mx=INT_MIN;
    cin >> n;
    for (int i=0;i<n;i++){
        long long x;
        cin >> x;
        sum += x;
        mn = min(mn,x);
        mx = max(mx,x);
    }
    long long range = mx-mn;
    double long mean = (sum+0.0)/n;
    cout << range << ' ';
    cout << fixed << setprecision(2) << mean;
    return 0;
}