Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: letdown

Problemset: RANGEandMEAN

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-11 20:25:32

#include <iostream>

using namespace std;
int main() {
    long long n, mx, mn, sm;
    cin >> n;
    long long a[n];

    cin >> a[0];
    mx = a[0];
    mn = a[0];
    sm = a[0];
    for (int i = 1; i < n; i++) {
        cin >> a[i];
        if (a[i] > mx) mx = a[i];
        if (a[i] < mn) mn = a[i];
        sm += a[i];
    }

    cout << mx - mn << " ";
    printf("%.2f", double(sm)/double(n));
    
}