Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: qweqwe

Problemset: RANGEandMEAN

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-15 23:14:27

#include <bits/stdc++.h>
#define speed cin.tie(0)->sync_with_stdio(0)
#define ll long long
#define pii pair<int,int>

using namespace std;

int main(){
	speed;
	long double sum=0;
	double n;cin >> n;
	ll mx=0,mn=1e15;
	for (int i=0;i<n;i++){
		ll a;cin >> a;
		sum+=a;
		mx=max(mx,a);
		mn=min(mn,a);
	}
	cout << mx-mn << " ";
	cout << fixed << setprecision(2) << sum/n;
	return 0;
}