Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Sense.exe

Problemset: RANGEandMEAN

Language: cpp

Time: 0.005 second

Submitted On: 2026-10-08 17:32:52

#include <bits/stdc++.h>
using namespace std;

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