Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: punzacp555

Problemset: RANGEandMEAN

Language: cpp

Time: 0.002 second

Submitted On: 2026-09-29 22:13:32

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

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n;
    cin >> n;
    
    float sum = 0, fn = n;
    int mn = INT_MAX, mx = INT_MIN;

    while(n--) {
        int x;
        cin >> x;

        mn = min(mn, x);
        mx = max(mx, x);
        sum += x;
    }

    cout << mx-mn << ' ' << fixed << setprecision(2) << sum / fn;

    return 0;
}