Submission

Status:

PPPPPPPPPPPPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: kavin8888

Problemset: RANGEandMEAN

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-22 09:18:04

#include<bits/stdc++.h>
using namespace std;
#define spps1 ios::sync_with_stdio(false)
#define spps2 cin.tie(nullptr)
#define llb long double
#define ll long long
#define end0 return 0
int main() {
	ll  n; cin>>n;
	vector<ll> v(n);
	for(int i=0;i<n;i++) {
		cin>>v[i];
	}
	sort(v.begin(),v.end());
	ll ans1=0;
	llb ans2=0;
	ans1=v[n-1]-v[0];
	for(int i=0;i<n;i++) {
		ans2+=(v[i]);
	}
	cout<<ans1<<" ";
	cout<<fixed<<setprecision(2)<<ans2/n;
	end0;
}