Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Gundhon

Problemset: RANGEandMEAN

Language: cpp

Time: 0.004 second

Submitted On: 2026-10-07 16:07:10

#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
    vector<long long> num;
    int x,sum = 0;
    cin >> x;

    for(int i = 1; i <= x; i++){
        int y;
        cin >> y;
        num.push_back(y);
        sum += y;
    }

    auto[min,max] = minmax_element(num.begin(),num.end());
    

    cout << *max - *min << " " << fixed << setprecision(2) << (double)sum/x;
    



    return 0;
}