#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	long double l = 0,r = x;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2;
		long double xh = mid*2;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 3e9+17;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>=t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=l) ans = min(vc[i].first,ans);
	}
	cout<<ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	long double l = 0,r = x;
	for (int i = 0; i < 200; ++i)
	{
		long double mid = (l+r)/2.0;
		long double xh = mid*2.0;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2.0;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 200; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,9;
	cout<<ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	long double l = 0,r = x;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2;
		long double xh = mid*2;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	if(2*x<=v) return x;
	long double l = 0,r = x;
	for (int i = 0; i < 80; ++i)
	{
		long double mid = (l+r)/2.0;
		long double xh = mid*2.0;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2.0;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 80; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<(int)ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	if(v>=2*x) v = 2*x;
	double s2 = v-x,s1 = x-s2;
	return 2*s1+s2;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<(int)ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	if(2*x<=v) return x;
	long double l = 0,r = x;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2.0;
		long double xh = mid*2.0;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2.0;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<(int)ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	long double l = 0,r = x;
	for (int i = 0; i < 200; ++i)
	{
		long double mid = (l+r)/2.0;
		long double xh = mid*2.0;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2.0;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 200; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	if(v>=2*x) v = 2*x;
	double s2 = v-x,s1 = x-s2;
	return 2*s1+s2;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	if(k==200000) cout<<k<<endl;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<(int)ans<<endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <queue>
#include <cstring>
#include <map>
#define debug(x) //std::cerr << #x << " = " << (x) << std::endl
using namespace std;
typedef long long LL;
const int MAXN = 2e5 + 17;
const int MOD = 1e9 + 7;
vector<pair<long double,long double > > vc;
long double a[MAXN];
long double cal(long double v,long double x)
{
	long double l = 0,r = x;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2.0;
		long double xh = mid*2.0;
		if(x-mid>v-xh)
			r = mid;
		else
			l = mid;
	}
	long double ret = l + (x-l)*2.0;
	return ret;
}
int main(int argc, char const *argv[])
{
#ifdef noob
    freopen("Input.txt", "r", stdin);
    freopen("Output.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	long double n,k,s,t,mx = 0;
	cin>>n>>k>>s>>t;
	vc.resize(n);
	for (int i = 0; i < n; ++i)
	{
		cin>>vc[i].first>>vc[i].second;
	}
	a[0] = 0;
	for (int i = 1; i <= k; ++i)
	{
		cin>>a[i];
	}
	a[(int)(1+k)] = s;
	sort(a,a+(int)(k+2));
	for (int i = 1; i <= k+1; ++i)
		mx = max(a[i]-a[i-1],mx);
	long double l = mx,r = 1e10+17;
	for (int i = 0; i < 100; ++i)
	{
		long double mid = (l+r)/2,sum = 0;
		for (int j = 1; j <= k+1; ++j)
		{
			sum += cal(mid,a[j]-a[j-1]);
		}
		if(sum>t)
			l = mid;
		else
			r = mid;
	}
	long double ans = 3e9+7;
	for (int i = 0; i < n; ++i)
	{
		if((long double)vc[i].second>=r) ans = min(vc[i].first,ans);
	}
	if(ans==3e9+7) return cout<<-1<<endl,0;
	cout<<(int)ans<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define JUGAD freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define po pop_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define pii pair<int,int>
#define pll pair<lli,lli>
#define pdd pair<ld,ld>
#define ff first
#define ss second
const int N = 3e5+1;
const lli MOD = 998244353;

lli gcd(lli n,lli m){
	if(n==0){return m;}
	return gcd(m%n,n);
}

int main(){
	FAST;
	int n;cin>>n;
	lli ar[n+1];
	for(int i=1;i<=n;i++){
		cin>>ar[i];
	}
	lli sum[n+1];sum[0]=0;
	for(int i=1;i<=n;i++){
		sum[i]=sum[i-1]+ar[i];
	}
	lli x=0;
	for(lli i=1;i<=n;i++){
		x+=(i-1)*ar[i] - sum[i-1];
	}
	x*=2;x+=sum[n];
	lli g=gcd(x,n);
	cout<<x/g<<" "<<n/g<<endl;
}


#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ld = long double;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define JUGAD freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pb push_back
#define po pop_back
#define eb emplace_back
#define pf push_front
#define mp make_pair
#define pii pair<int,int>
#define pll pair<lli,lli>
#define pdd pair<ld,ld>
#define ff first
#define ss second
const int N = 3e5+1;
const lli MOD = 998244353;

lli gcd(lli n,lli m){
	if(n==0){return m;}
	return gcd(m%n,n);
}

int main(){
	FAST;
	int n;cin>>n;
	lli ar[n+1];
	for(int i=1;i<=n;i++){
		cin>>ar[i];
	}
	sort(ar+1,ar+n+1);
	lli sum[n+1];sum[0]=0;
	for(int i=1;i<=n;i++){
		sum[i]=sum[i-1]+ar[i];
	}
	lli x=0;
	for(lli i=1;i<=n;i++){
		x+= (i-1)*ar[i] - sum[i-1];
	}
	x*=2;x+=sum[n];
	lli g=gcd(x,n);
	cout<<x/g<<" "<<n/g<<endl;
}


#include <bits/stdc++.h>

#define ll long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define phi 3.1415926535
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;

const ll mod = 1000000007;

ll tc, cnt = 0, number, many, total = 0, query, require, length;
int rmove[8] = {1, 0, 0, -1, -1, 1, -1, 1};
int cmove[8] = {0, -1, 1, 0, 1, -1, -1, 1};

ll modpow(ll x, ll y, ll m)
{
    ll res = 1;
    while(y > 0)
    {
        if(y & 1)
            res = (res * x) % m;
        x = (x * x) % m;
        y >>= 1;
    }

    return res;
}

int main()
{
    fastio();

    // freopen("input.txt","r", stdin);
    // freopen("output.txt","w", stdout);
    // g++ -std=c++11 Default.cpp  -o test
    // g++ -Wl,--stack=268435456 -std=c++11 Default.cpp  -o test

    cin >> many;

    ll arr[many], answer = 0;
    for(int i = 0; i < many; i++)
    {
        cin >> arr[i];
        answer += arr[i];
    }

    sort(arr, arr + many);

    ll sum = 0, before = 0;
    for(int i = 0; i < many; i++)
    {
        sum += arr[i] * i - before;
        before += arr[i];
    }

    answer += 2 * sum;

    ll temp = __gcd(answer, many);
    cout << answer / temp << " " << many / temp << '\n';

    //
    return 0;
}


#include <bits/stdc++.h>

#define ll long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define phi 3.1415926535
#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;

const ll mod = 1000000007;

ll tc, cnt = 0, number, many, total = 0, query, require, length;
int rmove[8] = {1, 0, 0, -1, -1, 1, -1, 1};
int cmove[8] = {0, -1, 1, 0, 1, -1, -1, 1};

ll modpow(ll x, ll y, ll m)
{
    ll res = 1;
    while(y > 0)
    {
        if(y & 1)
            res = (res * x) % m;
        x = (x * x) % m;
        y >>= 1;
    }

    return res;
}

int main()
{
    fastio();

    // freopen("input.txt","r", stdin);
    // freopen("output.txt","w", stdout);
    // g++ -std=c++11 Default.cpp  -o test
    // g++ -Wl,--stack=268435456 -std=c++11 Default.cpp  -o test

    cin >> many;

    int arr[many];
    for(int i = 0; i < many; i++)
        cin >> arr[i];

    ll top = 0, bottom = many * (many + 1) / 2;
    for(int i = 0; i < many; i++)
    {
        top += arr[i];
        top += arr[i];
        for(int j = i + 1; j < many; j++)
        {
            top += abs(arr[i] - arr[j]);
            top += abs(arr[i] - arr[j]);
            top += abs(arr[i] - arr[j]);
            top += abs(arr[i] - arr[j]);
        }
    }

    // cout << top << '\n';

    ll temp = __gcd(top, bottom);
    top /= temp;
    bottom /= temp;

    cout << top << " " << bottom << '\n';

    //
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n+1);
    rep(i,1,n){
        sum[i+1]=(sum[i]+i*(arr[i+1]-arr[i]));
        tot+=sum[i+1];
    //    debug(tot);
    }
//    tot=;
    tot=tot*2;
    tot+=cnt;
  //  debug(tot);
    ll ans2=n;
    ll k=__gcd(tot,ans2);
    cout<<tot/k<<" "<<ans2/k;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n+1);
    rep(i,1,n){
        sum[i+1]=(sum[i]+i*(arr[i+1]-arr[i]));
        tot+=sum[i+1];
        debug(tot);
    }
//    tot=;
    tot=tot*2;
    tot+=cnt;
  //  debug(tot);
    ll ans2=n;
    ll k=__gcd(tot,ans2)
    cout<<tot/k<<" "<<ans2/k;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

ll a[100005]={0};
vec prime;
void cal()
{
    for(ll i=2;i*i<100005;i++)
    {
        if(a[i]==1)
            continue;
        prime.pb(i);
        ll j=2*i;
        while(j<100005)
        {
            a[j]=1;
            j+=i;
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cal();
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n+1);
    rep(i,1,n){
        sum[i+1]=(sum[i]+i*(arr[i+1]-arr[i]));
        tot+=sum[i+1];
        debug(tot);
    }
//    tot=;
    tot=tot*2;
    tot+=cnt;
  //  debug(tot);
    ll ans2=1;
    ll j=0,k=n;
        while(k!=1)
        {
            while(k%prime[j]==0)
            {
                if(tot%prime[j]==0)
                    tot=tot/prime[j];
                else
                    ans2=ans2*prime[j];
                k=k/prime[j];
            }
            j++;
        }
    cout<<tot<<" "<<ans2;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n+1);
    rep(i,1,n){
        sum[i+1]=(sum[i]+i*(arr[i+1]-arr[i]));
        tot+=sum[i+1];
        debug(tot);
    }
//    tot=;
    tot=tot*2;
    tot+=cnt;
  //  debug(tot);
    ll ans2=n;
    ll k=__gcd(tot,ans2);
    cout<<tot/k<<" "<<ans2/k;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n+1);
    rep(i,1,n){
        sum[i+1]=(sum[i]+i*(arr[i+1]-arr[i]));
        tot+=sum[i+1];
        debug(tot);
    }
//    tot=;
    tot=tot*2;
    tot+=cnt;
  //  debug(tot);
    ll ans2=1;
    ll j=2,k=n;
        while(k!=1)
        {
            while(k%j==0)
            {
                if(tot%j==0)
                    tot=tot/j;
                else
                    ans2=ans2*j;
                k=k/j;
            }
            j++;
        }
    cout<<tot<<" "<<ans2;
}


#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<ll,ll>
#define mii map<ll,ll>
#define vec vector<ll>
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define HASH 18014398241046527
#define debug(x)    cerr << #x << " = " << x << endl;

ll a[100005]={0};
vec prime;
void cal()
{
    for(ll i=2;i*i<100005;i++)
    {
        if(a[i]==1)
            continue;
        prime.pb(i);
        ll j=2*i;
        while(j<100005)
        {
            a[j]=1;
            j+=i;
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cal();
    ll n,cnt=0,tot=0;
    cin>>n;
    ll arr[n+1],sum[n+1]={0};
    arr[0]=(-1)*HASH;
    rep(i,1,n+1){
        cin>>arr[i];
        cnt+=arr[i];
    }
    sort(arr,arr+n);
    rep(i,2,n)
        sum[i]=sum[i-1]+(arr[i]-arr[i-1]);
    rep(i,1,n)
        tot+=(sum[i]+i*(arr[i+1]-arr[i]));
    tot=tot*2*(n-1);
    tot+=(2*cnt);
   // debug(tot);
    ll ans2=1;
    rep(i,2,n+1)
    {
        ll j=0,k=i;
        while(k!=1)
        {
            while(k%prime[j]==0)
            {
                if(tot%prime[j]==0)
                    tot=tot/prime[j];
                else
                    ans2=ans2*prime[j];
                k=k/prime[j];
            }
            j++;
        }
    }
    cout<<tot<<" "<<ans2;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn 100000

ll gcd(ll a, ll b) {
	ll pr = a, r = b;
	ll q, h;
	while(r) {
		q = pr / r ;
		h = r;
		r = pr - q * r;
		pr = h;
	}
	return pr;
}

int main() {
	ll n, i, a, num = 0, sum = 0;
	scanf("%lld", &n);
	for (i = 0; i < n; i++) {
		scanf("%lld", &a);
		num += i * a - sum;
		sum += a;
	}
	num <<= 1;
	num += sum;
	a = gcd(num, n);
	printf("%lld %lld", num / a, n / a);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define maxn 100000

ll gcd(ll a, ll b) {
	ll pr = a, r = b;
	ll q, h;
	while(r) {
		q = pr / r ;
		h = r;
		r = pr - q * r;
		pr = h;
	}
	return pr;
}
ll p[maxn];

int main() {
	ll n, i, num = 0, sum = 0, g;
	scanf("%lld", &n);
	for (i = 0; i < n; i++)
		scanf("%lld", p + i);
	sort(p, p + n);
	for (i = 0; i < n; i++) {
		num += i * p[i] - sum;
		sum += p[i];
	}
	num <<= 1;
	num += sum;
	g = gcd(num, n);
	num /= g;
	n /= g;
	printf("%lld %lld", num, n);
	return 0;
}


#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int mod = 998244353;
const int inf = 2e9 + 5;

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vi a(n+1);
    for (int i = 1; i <= n; i++) cin >> a[i];

    sort(all(a));

    ll sum = 0, sleft = 0;

    for (int i = 1; i <= n; i++) {
        sleft += (i - 1) * a[i] - sum;
        sum += a[i];
    }

    ll p = sum + 2 * sleft;
    ll q = n;

    ll g = __gcd(p, q);
    p /= g; q /= g;

    cout << p << " " << q << "\n";
    return 0;
}


#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int mod = 998244353;
const int inf = 2e9 + 5;

int main() {
    ios::sync_with_stdio(false);

    int n;
    cin >> n;

    vi a(n+1);
    for (int i = 1; i <= n; i++) cin >> a[i];

    sort(all(a));

    ll sum = 0, sleft = 0;

    for (int i = 1; i <= n; i++) {
        sleft += (i - 1) * (ll)a[i] - sum;
        sum += a[i];
    }

    ll p = sum + 2 * sleft;
    ll q = n;

    ll g = __gcd(p, q);
    p /= g; q /= g;

    cout << p << " " << q << "\n";
    return 0;
}


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

const int md = (int)1e9 + 7; // 模数定义

inline void add(int& a, int b) {
	a += b;
	if (a >= md) a -= md;
}

inline void sub(int& a, int b) {
	a -= b;
	if (a < 0) a += md;
}

inline int mul(int a, int b) {
	return (int)((long long)a * b % md);
}

inline int powmod(int a, long long b) {
	int res = 1;
	while (b > 0) {
		if (b & 1) res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

inline int inv(int a) {
	a %= md;
	if (a < 0) a += md;
	int b = md, u = 0, v = 1;
	while (a) {
		int t = b / a;
		b -= t * a; swap(a, b);
		u -= t * v; swap(u, v);
	}
	assert(b == 1);
	if (u < 0) u += md;
	return u;
}

constexpr int top = 10000;
vector<int> fac(top + 1), ifac(top + 1);

int c(int n, int m) {
	if (n < m || n < 0 || m < 0) return 0;
	return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

long long gcd(long long a, long long b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	fac[0] = 1;
	for (int i = 1; i <= top; i++) fac[i] = mul(fac[i - 1], i);
	ifac[top] = inv(fac[top]);
	for (int i = top; i; i--) ifac[i - 1] = mul(ifac[i], i);

	int n; cin >> n;
	vector<int> a(n);
	for (auto& i : a) cin >> i;
	sort(a.begin(), a.end(), greater<int>());
	vector<long long> pre(n);
	pre[0] = a[0];
	for (int i = 1; i < n; i++)
		pre[i] = pre[i - 1] + a[i];
	long long pa = 0, pb = n;
	pa = accumulate(a.begin(), a.end(), 0LL);
	for (int i = 0; i < n; i++) {
		pa += 2LL * (1LL * (n - i - 1) * a[i] - pre[n - 1] + pre[i]);
	}
	long long g = gcd(pa, pb);
	cout << pa / g << ' ' << pb / g << '\n';
	return 0;
}


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

const int md = (int)1e9 + 7; // 模数定义

inline void add(int& a, int b) {
	a += b;
	if (a >= md) a -= md;
}

inline void sub(int& a, int b) {
	a -= b;
	if (a < 0) a += md;
}

inline int mul(int a, int b) {
	return (int)((long long)a * b % md);
}

inline int powmod(int a, long long b) {
	int res = 1;
	while (b > 0) {
		if (b & 1) res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

inline int inv(int a) {
	a %= md;
	if (a < 0) a += md;
	int b = md, u = 0, v = 1;
	while (a) {
		int t = b / a;
		b -= t * a; swap(a, b);
		u -= t * v; swap(u, v);
	}
	assert(b == 1);
	if (u < 0) u += md;
	return u;
}

constexpr int top = 10000;
vector<int> fac(top + 1), ifac(top + 1);

int c(int n, int m) {
	if (n < m || n < 0 || m < 0) return 0;
	return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

long long gcd(long long a, long long b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	fac[0] = 1;
	for (int i = 1; i <= top; i++) fac[i] = mul(fac[i - 1], i);
	ifac[top] = inv(fac[top]);
	for (int i = top; i; i--) ifac[i - 1] = mul(ifac[i], i);

	int n; cin >> n;
	vector<int> a(n);
	for (auto& i : a) cin >> i;
	sort(a.begin(), a.end(), greater<int>());
	vector<long long> pre(n);
	pre[0] = a[0];
	for (int i = 1; i < n; i++)
		pre[i] = pre[i - 1] + a[i];
	long long pa = 0, pb = n;
	pa = accumulate(a.begin(), a.end(), 0LL);
	for (int i = 0; i < n; i++) {
		pa += 2LL * ((n - i - 1) * a[i] - pre[n - 1] + pre[i]);
	}
	long long g = gcd(pa, pb);
	cout << pa / g << ' ' << pb / g << '\n';
	return 0;
}


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

const int md = (int)1e9 + 7; // 模数定义

inline void add(int& a, int b) {
	a += b;
	if (a >= md) a -= md;
}

inline void sub(int& a, int b) {
	a -= b;
	if (a < 0) a += md;
}

inline int mul(int a, int b) {
	return (int)((long long)a * b % md);
}

inline int powmod(int a, long long b) {
	int res = 1;
	while (b > 0) {
		if (b & 1) res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

inline int inv(int a) {
	a %= md;
	if (a < 0) a += md;
	int b = md, u = 0, v = 1;
	while (a) {
		int t = b / a;
		b -= t * a; swap(a, b);
		u -= t * v; swap(u, v);
	}
	assert(b == 1);
	if (u < 0) u += md;
	return u;
}

constexpr int top = 10000;
vector<int> fac(top + 1), ifac(top + 1);

int c(int n, int m) {
	if (n < m || n < 0 || m < 0) return 0;
	return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

long long gcd(long long a, long long b) {
	return b == 0 ? a : gcd(b, a % b);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	fac[0] = 1;
	for (int i = 1; i <= top; i++) fac[i] = mul(fac[i - 1], i);
	ifac[top] = inv(fac[top]);
	for (int i = top; i; i--) ifac[i - 1] = mul(ifac[i], i);

	int n; cin >> n;
	vector<int> a(n);
	for (auto& i : a) cin >> i;
	long long pa = 0, pb = n;
	pa = accumulate(a.begin(), a.end(), 0LL);
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			pa += 2LL * abs(a[i] - a[j]);
		}
	}
	long long g = gcd(pa, pb);
	cout << pa << ' ' << pb << '\n';
	return 0;
}


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

const int md = (int)1e9 + 7; // 模数定义

inline void add(int& a, int b) {
	a += b;
	if (a >= md) a -= md;
}

inline void sub(int& a, int b) {
	a -= b;
	if (a < 0) a += md;
}

inline int mul(int a, int b) {
	return (int)((long long)a * b % md);
}

inline int powmod(int a, long long b) {
	int res = 1;
	while (b > 0) {
		if (b & 1) res = mul(res, a);
		a = mul(a, a);
		b >>= 1;
	}
	return res;
}

inline int inv(int a) {
	a %= md;
	if (a < 0) a += md;
	int b = md, u = 0, v = 1;
	while (a) {
		int t = b / a;
		b -= t * a; swap(a, b);
		u -= t * v; swap(u, v);
	}
	assert(b == 1);
	if (u < 0) u += md;
	return u;
}

constexpr int top = 10000;
vector<int> fac(top + 1), ifac(top + 1);

int c(int n, int m) {
	if (n < m || n < 0 || m < 0) return 0;
	return mul(fac[n], mul(ifac[m], ifac[n - m]));
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	fac[0] = 1;
	for (int i = 1; i <= top; i++) fac[i] = mul(fac[i - 1], i);
	ifac[top] = inv(fac[top]);
	for (int i = top; i; i--) ifac[i - 1] = mul(ifac[i], i);

	int n; cin >> n;
	vector<int> a(n);
	for (auto& i : a) cin >> i;
	long long pa = 0, pb = n;
	pa = accumulate(a.begin(), a.end(), 0LL);
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			pa += 2LL * abs(a[i] - a[j]);
		}
	}
	long long g = __gcd(pa, pb);
	cout << pa / g << ' ' << pb / g << '\n';
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	ll a[n], sum = 0, presum = 0, ans = 0;
	for(int i = 0; i < n; i++){
	    cin >> a[i];
	    sum += a[i];
	}
	sort(a, a + n);
    for(int i = 0; i < n; i++){
        ans += 2*(i*a[i] - presum);
        presum += a[i];
    }
    ans += sum;
    ll k = n;
    cout << ans/(__gcd(ans,k)) << " " << k/__gcd(ans,k) << endl;
	return 0;
}


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

int main() {
	int n;
	cin >> n;
	ll a[n], sum = 0, presum = 0, ans = 0;
	for(int i = 0; i < n; i++){
	    cin >> a[i];
	    sum += a[i];
	}
	sort(a, a + n);
    for(int i = 0; i < n; i++){
        ans += 2*(i*a[i] - presum);
        presum += a[i];
    }
    ans += sum;
    ll k = n;
    for(int j = 2; j*j <= (ans); j++){
        while(!(ans%j) && !(k%j)){
            ans /= j;
            k /= j;
        }
    }
    cout << ans << " " << k << endl;
	return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353

using namespace std;
using namespace __gnu_pbds;

typedef
tree<
	pair<int, int>,
	null_type,
	less<pair<int, int>>,
	rb_tree_tag,
	tree_order_statistics_node_update>
ordered_set;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

int main()
{
    IOS;
    ll n;
    cin>>n;
    ll a[n],s=0;
    repf(i,0,n)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a,a+n);
    ll num=0;
    repf(i,0,n)
    {
        num+=i*(2*n-4+2)*a[i]-(n-i-1)*(2*n-4+2)*a[i];
    }
    ll den=1;
    repf(i,2,n+1)
    {
        if(num%i)
        {
            den*=i;
        }
        else num/=i;
    }
    num=num*n+den*s;
    den*=n;
    ll g=__gcd(num,den);
    num/=g;
    den/=g;
    cout<<num<<" "<<den<<endl;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353

using namespace std;
using namespace __gnu_pbds;

typedef
tree<
	pair<int, int>,
	null_type,
	less<pair<int, int>>,
	rb_tree_tag,
	tree_order_statistics_node_update>
ordered_set;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

int main()
{
    IOS;
    ll n;
    cin>>n;
    ll a[n],s=0;
    repf(i,0,n)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a,a+n);
    ll num=s;
    repf(i,0,n)
    {
        num+=(i*a[i]-(n-i-1)*a[i])*2;
    }
    // cout<<num<<endl;
    ll den=n;
    ll g=__gcd(num,den);
    num/=g;
    den/=g;
    cout<<num<<" "<<den<<endl;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    int arr[n];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    cout << (tmp * 2 + sum) / __gcd(1ll * tmp * 2 + sum, 1ll * n) << " " << n / __gcd(1ll * tmp * 2 + sum, 1ll * n);
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n;
    cin >> n;
    ll arr[n + 9];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    ll GCD = __gcd(tmp * 2ll + sum, n);
    cout << (std::size_t) (tmp * 2ll + sum) / GCD << " " << n / GCD;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n;
    cin >> n;
    ll arr[n + 9];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    ll GCD = __gcd(tmp * 2ll + sum, n);
    cout << 1ll * (tmp * 2ll + sum) / GCD << " " << n / GCD;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    int arr[n];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) cin >> arr[i];
    sort(arr, arr + n);
    do {
        ll tmsm = 0;
        ctr++;
        int tmp = 0;
        for (int i = 0; i < n; i++) {
            tmsm += abs(tmp - arr[i]);
            tmp = arr[i];
        }
        sum += tmsm;
    } while (next_permutation(arr, arr + n));
    ll x = __gcd(1ll*sum, 1ll*ctr);
    sum /= x;
    ctr /= x;
    cout << sum << " " << ctr;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n;
    cin >> n;
    ll arr[n+9];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    cout << (tmp * 2 + sum) / __gcd(1ll * tmp * 2 + sum, 1ll * n) << " " << n / __gcd(1ll * tmp * 2 + sum, 1ll * n) << endl;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n;
    cin >> n;
    ll arr[n + 9];
    ll sum = 0;
    int ctr = 0;
    for (int i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    ll tmp = 0;
    for (int i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    ll GCD = __gcd(tmp * 2ll + sum, n);
    cout << (double) (tmp * 2ll + sum) / GCD << " " << n / GCD;
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define UNIQUE(v)       sort(all(v));v.erase(unique(all(v)),v.end());
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
int main() {
#ifdef online_judge
    freopen("input.txt", "wt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    size_t n;
    cin >> n;
    size_t arr[n + 9];
    size_t sum = 0;
    size_t ctr = 0;
    for (size_t i = 0; i < n; i++) {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n);
    size_t tmp = 0;
    for (size_t i = 0; i < n; i++) {
        tmp += arr[i] * i - ctr;
        ctr += arr[i];
    }
    size_t GCD = __gcd(tmp * 2ll + sum, 1ll * n);
    cout << (size_t) (tmp * 2ll + sum) / GCD << " " << n / GCD;
    return 0;
}


#include <bits/stdc++.h>
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
#define MOD 1000000007 //1e9 + 7
#define INF 1000000000000000007 // 1e18+7
#define ll long long
#define int long long
#define pb push_back
#define pairs pair <int, int>
#define mp make_pair
#define ff first
#define ss second
#define forn(i, n) for (int i=0; i<int(n); i++)
int gcd(int a, int b) {
	if (a > b) {
		swap(a, b);
	}
	if (a==0)
		return b;
	return gcd(b%a, a);
}
void fun(int &a, int &b) {
	int ta = a;
	int tb = b;
	a = a/gcd(ta, tb);
	b = b/gcd(ta, tb);
}

int32_t main()
{
	IOS;
	int n;
	cin>>n;
	int arr[n];
	int s1(0), s2(0);
	for (int i=0; i<n; i++) {
		cin>>arr[i];
		s1 += arr[i];
	}
	sort(arr, arr+n);
	for (int i=0; i<n; i++) {
		for (int j=i+1; j<n; j++) {
			s2 += arr[j] - arr[i];
		}
	}
	int a1 = (s1 + 2*s2);
	int a2 = n;
	fun(a1, a2);
	cout<<a1<<" "<<a2<<endl;
	return 0;
}


#include <bits/stdc++.h>
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
#define MOD 1000000007 //1e9 + 7
#define INF 1000000000000000007 // 1e18+7
#define ll long long
#define int long long
#define pb push_back
#define pairs pair <int, int>
#define mp make_pair
#define ff first
#define ss second
#define forn(i, n) for (int i=0; i<int(n); i++)
int gcd(int a, int b) {
	if (a > b) {
		swap(a, b);
	}
	if (a==0)
		return b;
	return gcd(b%a, a);
}
void fun(int &a, int &b) {
	int ta = a;
	int tb = b;
	a = a/gcd(ta, tb);
	b = b/gcd(ta, tb);
}

int32_t main()
{
	IOS;
	int n;
	cin>>n;
	int arr[n];
	int s1(0), s2(0);
	for (int i=0; i<n; i++) {
		cin>>arr[i];
		s1 += arr[i];
	}
	sort(arr, arr+n);
	for (int i=0; i<n; i++) {
		s2 += arr[i]*i;
		s2 -= arr[i]*(n-i-1);
	}
	int a1 = (s1 + 2*s2);
	int a2 = n;
	fun(a1, a2);
	cout<<a1<<" "<<a2<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define help freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
int arr[100009];
int extra[100009];
int main()
{
    ll sum = 0ll;
    int n;
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> arr[i];
        sum += arr[i];
        extra[i] = arr[i] + extra[i - 1];
    }
    sort(arr, arr + n + 1);
    ll sp = 0ll;
    for (int i = 1; i <= n; i++)
    {
        ll x = (arr[i] * (i - 1)) - extra[i - 1];
        //ll y = (extra[n] - extra[i]) - (arr[i] * (n - i));
        //cout << x << " " << y << endl;
        sp += x;
        //cout << sp << endl;
    }
    sum = sum + sp + sp;
    ll g = __gcd(sum, ll(n));
    cout << sum / g << " " << n / g << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define help freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
int arr[100009];
int extra[100009];
int main()
{
    ll sum = 0ll;
    int n;
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n + 1);
    for (int i = 1; i <= n; i++)
        extra[i] = extra[i - 1] + arr[i];
    ll sp = 0ll;
    for (int i = 1; i <= n; i++)
    {
        ll x = (arr[i] * (i - 1)) - extra[i - 1];
        ll y = (extra[n] - extra[i]) - (arr[i] * (n - i));
        //cout << x << " " << y << endl;
        sp += (x + y);
        //cout << sp << endl;
    }
    sum = sum + sp;
    ll g = __gcd(sum, ll(n));
    cout << sum / g << " " << n / g << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define help freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
int arr[100009];
int extra[100009];
int main()
{
    ll sum = 0ll;
    int n;
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> arr[i];
        sum += arr[i];
        extra[i] = arr[i] + extra[i - 1];
    }
    sort(arr, arr + n + 1);
    ll sp = 0ll;
    for (int i = 1; i <= n; i++)
    {
        ll x = (arr[i] * (i - 1)) - extra[i - 1];
        ll y = (extra[n] - extra[i]) - (arr[i] * (n - i));
        //cout << x << " " << y << endl;
        sp += (x + y);
        //cout << sp << endl;
    }
    sum = sum + sp;
    ll g = __gcd(sum, ll(n));
    cout << sum / g << " " << n / g << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define help freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)

int main()
{
    int n;
    cin >> n;
    ll sum1 = 0, sum2 = 0;
    ll tot = 0;
    int arr[n + n + 5];
    for (int i = 0; i < n; i++)
    {
        ll x;
        cin >> x;
        arr[i] = x;
        arr[i + n] = x;
        sum2 = sum2 + x + x;
        if (i > 0)
            tot = tot + abs(x - arr[i - 1]);
    }
    sum1 = tot + tot;

    for (int i = n - 1, j = 1; j < n; i++, j++)
    {
        tot = tot - abs(arr[j] - arr[j - 1]) + abs(arr[i] - arr[i + 1]);
        sum1 = sum1 + tot + tot;

    }

    sum1 = sum1 + sum2;
    ll den = 1;
    for (int i = 2; i <= n; i++)
    {
        ll t = i;
        ll x = __gcd(t, sum1);
        if (x != 1ll)
            sum1 = sum1 / x, t = t / x;
        den = den * t;
    }
    cout << sum1 << " " << den << endl;

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
#define help freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
ll arr[100009];
ll extra[100009];
int main()
{
    ll sum = 0ll;
    ll n;
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> arr[i];
        sum += arr[i];
    }
    sort(arr, arr + n + 1);
    for (int i = 1; i <= n; i++)
        extra[i] = extra[i - 1] + arr[i];
    ll sp = 0ll;
    for (int i = 1; i <= n; i++)
    {
        ll x = (arr[i] * (i - 1)) - extra[i - 1];
        ll y = (extra[n] - extra[i]) - (arr[i] * (n - i));
        //cout << x << " " << y << endl;
        sp += (x + y);
        //cout << sp << endl;
    }
    sum = sum + sp;
    ll g = __gcd(sum, ll(n));
    cout << sum / g << " " << n / g << endl;

    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define MOD 1000000007
#define oo 1000000000000000000
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define pb push_back
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace __gnu_pbds;
using namespace std;

template<typename...T>
void read(T&... args){
    ((cin >> args), ...);
}

ll valueOfIndex(ordered_set&s , ll i){ return *(s.find_by_order(i)); }
ll indexOfValue(ordered_set&s , ll x){ return s.order_of_key(x); }

ll add(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a+b + p)%p;}
ll mul(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a*b + p)%p;} // __int128

ll power(ll x,ll n,ll p=MOD){ if(x==0) return 0; if(n==0 || x==1) return 1LL;
    ll r = (power(x,n/2,p))%p; if(n&1) return mul(mul(r,r,p) , x,p); else return mul(r,r,p);
}

void __sol(){

    ll n; cin >> n;
    ll a[n+1];
    a[0]=0;
    forr(i,n) cin >> a[i+1];
    ll sum=0;
    for(int i=2;i<=n;i++) sum+= a[i]-a[1];
    ll cnt=n-1;
    ll up = sum;
    for(int i=2;i<=n;i++){
         sum -= cnt*(a[i] - a[i-1]);
         up +=sum;
         cnt--;
    }
    up = up*2LL;
    for(int i=1;i<=n;i++) up += a[i];
    cout << up/__gcd(up,n) << " " << n/__gcd(up,n);

    return;
}

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastio
    ll tc=1;// cin >> tc;
    while(tc--) __sol();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define MOD 1000000007
#define oo 1000000000000000000
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define pb push_back
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

using namespace __gnu_pbds;
using namespace std;

template<typename...T>
void read(T&... args){
    ((cin >> args), ...);
}

ll valueOfIndex(ordered_set&s , ll i){ return *(s.find_by_order(i)); }
ll indexOfValue(ordered_set&s , ll x){ return s.order_of_key(x); }

ll add(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a+b + p)%p;}
ll mul(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a*b + p)%p;} // __int128

ll power(ll x,ll n,ll p=MOD){ if(x==0) return 0; if(n==0 || x==1) return 1LL;
    ll r = (power(x,n/2,p))%p; if(n&1) return mul(mul(r,r,p) , x,p); else return mul(r,r,p);
}

void __sol(){

    ll n; cin >> n;
    ll a[n+1];
    a[0]=0;
    forr(i,n) cin >> a[i+1];
    sort(a,a+n+1);
    ll sum=0;
    for(int i=2;i<=n;i++) sum+= a[i]-a[1];
    ll cnt=n-1;
    ll up = sum;
    for(int i=2;i<=n;i++){
         sum -= cnt*(a[i] - a[i-1]);
         up +=sum;
         cnt--;
    }
    up = up*2LL;
    for(int i=1;i<=n;i++) up += a[i];
    cout << up/__gcd(up,n) << " " << n/__gcd(up,n);

    return;
}

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastio
    ll tc=1;// cin >> tc;
    while(tc--) __sol();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> x(100010);
int main() {
    ll n;
    ll sum1 = 0, sum2 = 0, sumBefore = 0, sumtot = 0;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
	cin >> x[i];
	sum1 += x[i];
    }
    sort(x + 1, x + n + 1);
    for (int i = 1; i <= n; ++i) {
	sum2 += x[i] * (i - 1) - sumBefore;
	sumBefore += x[i];
    }
    sumtot = sum1 + 2 * sum2;
    ll _gcd = __gcd(sumtot, n);
    printf("%I64d %I64d", sumtot / _gcd, n / _gcd);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll x[100010];
int main() {
    ll n;
    ll sum1 = 0, sum2 = 0, sumBefore = 0, sumtot = 0;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
	cin >> x[i];
	sum1 += x[i];
    }
    sort(x + 1, x + n + 1);
    for (int i = 1; i <= n; ++i) {
	sum2 += x[i] * (i - 1) - sumBefore;
	sumBefore += x[i];
    }
    sumtot = sum1 + 2 * sum2;
    ll _gcd = __gcd(sumtot, n);
    printf("%I64d %I64d", sumtot / _gcd, n / _gcd);
    return 0;
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
template<typename T>
void __p(T a) {
	cout << a;
}
template<typename T, typename F>
void __p(pair<T, F> a) {
	cout << "{";
	__p(a.first);
	cout << ",";
	__p(a.second);
	cout << "}";
}
template<typename T>
void __p(std::vector<T> a) {
	cout << "{";
	for (auto it = a.begin(); it < a.end(); it++)
		__p(*it), cout << ",}"[it + 1 == a.end()];
}
template<typename T, typename ...Arg>
void __p(T a1, Arg ...a) {
	__p(a1);
	__p(a...);
}
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cout << name << " : ";
	__p(arg1);
	cout << endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	int bracket = 0, i = 0;
	for (;; i++)
		if (names[i] == ',' && bracket == 0)
			break;
		else if (names[i] == '(')
			bracket++;
		else if (names[i] == ')')
			bracket--;
	const char *comma = names + i;
	cout.write(names, comma - names) << " : ";
	__p(arg1);
	cout << " | ";
	__f(comma + 1, args...);
}
#define trace(...) cout<<"Line:"<<__LINE__<<" ", __f(#__VA_ARGS__, __VA_ARGS__);
#else
#define trace(...)
#endif
typedef long long int ll;
#define oset tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef pair<ll , ll> pp;
typedef pair<pair<ll, ll>, ll> ppp;
#define X first
#define Y second
#define getones(n) __builtin_popcountll(n)
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define frv(i,a,b) for (ll i = (a), _b = (b); i < _b; i++)
#define frrv(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define fr(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define frr(i,n) for (ll i = n - 1]; i >= 0; i--)
#define fordata(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) fr(i,sizeof(ar)/sizeof(ll)) ar[i]=val
#define fill2(ar,val) fr(i,sizeof(ar)/sizeof(ar[0])) fr(j,sizeof(ar[0])/sizeof(ll)) ar[i][j]=val
#define fill0(ar) memset(ar,0,sizeof(ar))
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define all(ar) ar.begin(), ar.end()
#define INF 1000000000000000000
#define PI 3.14159265358979323846L
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
const ll N = 1e6 + 1;
const ll K = 1e9 + 7;
#define vv vector<ll>
const ll globalmod = 1e9 + 9;
ll dx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
ll dy[8] = {0, -1, 1, 1, 0, -1, 1, -1};
vv avail;
ll m;
ll dp[1001][11][11];
// char ch = 'a';
int main() {
	ll n;
	cin >> n;
	vv a(n + 1, 0);
	ll sum = 0;
	vv pre(n + 1, 0);
	frv(i, 1, n + 1) {
		cin >> a[i];
		sum += a[i];
		pre[i] = pre[i - 1] + a[i];
	}
	trace(a, pre)
	ll sum2 = 0;
	sort(all(a));
	frv(i, 1, n + 1) {
		sum2 += (2 * (2 * i - n - 1) + 1) * a[i];
		trace(sum2)
	}
	// sum2 *= 2;
	trace(sum2 + sum)
	cout << sum2 / (__gcd(sum2, n)) << " " << n / (__gcd(sum2, n));
}


#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
template<typename T>
void __p(T a) {
	cout << a;
}
template<typename T, typename F>
void __p(pair<T, F> a) {
	cout << "{";
	__p(a.first);
	cout << ",";
	__p(a.second);
	cout << "}";
}
template<typename T>
void __p(std::vector<T> a) {
	cout << "{";
	for (auto it = a.begin(); it < a.end(); it++)
		__p(*it), cout << ",}"[it + 1 == a.end()];
}
template<typename T, typename ...Arg>
void __p(T a1, Arg ...a) {
	__p(a1);
	__p(a...);
}
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
	cout << name << " : ";
	__p(arg1);
	cout << endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
	int bracket = 0, i = 0;
	for (;; i++)
		if (names[i] == ',' && bracket == 0)
			break;
		else if (names[i] == '(')
			bracket++;
		else if (names[i] == ')')
			bracket--;
	const char *comma = names + i;
	cout.write(names, comma - names) << " : ";
	__p(arg1);
	cout << " | ";
	__f(comma + 1, args...);
}
#define trace(...) cout<<"Line:"<<__LINE__<<" ", __f(#__VA_ARGS__, __VA_ARGS__);
#else
#define trace(...)
#endif
typedef long long int ll;
#define oset tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
typedef pair<ll , ll> pp;
typedef pair<pair<ll, ll>, ll> ppp;
#define X first
#define Y second
#define getones(n) __builtin_popcountll(n)
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
#define fastIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define frv(i,a,b) for (ll i = (a), _b = (b); i < _b; i++)
#define frrv(i,a,b) for (ll i = (a), _b = (b); i >= _b; i--)
#define fr(i,n) for (ll i = 0, _n = (n); i < _n; i++)
#define frr(i,n) for (ll i = n - 1]; i >= 0; i--)
#define fordata(it,ar) for (auto it = ar.begin(); it != ar.end(); it++)
#define fill(ar,val) fr(i,sizeof(ar)/sizeof(ll)) ar[i]=val
#define fill2(ar,val) fr(i,sizeof(ar)/sizeof(ar[0])) fr(j,sizeof(ar[0])/sizeof(ll)) ar[i][j]=val
#define fill0(ar) memset(ar,0,sizeof(ar))
#define sz(x) (int)x.size()
#define len(x) (int)x.length()
#define all(ar) ar.begin(), ar.end()
#define INF 1000000000000000000
#define PI 3.14159265358979323846L
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
const ll N = 1e6 + 1;
const ll K = 1e9 + 7;
#define vv vector<ll>
const ll globalmod = 1e9 + 9;
ll dx[8] = {1, 1, 1, -1, -1, -1, 0, 0};
ll dy[8] = {0, -1, 1, 1, 0, -1, 1, -1};
vv avail;
ll m;
ll dp[1001][11][11];
// char ch = 'a';
int main() {
	ll n;
	cin >> n;
	vv a(n + 1, 0);
	ll sum = 0;
	vv pre(n + 1, 0);
	frv(i, 1, n + 1) {
		cin >> a[i];
		sum += a[i];
		pre[i] = pre[i - 1] + a[i];
	}
	trace(a, pre)
	ll sum2 = 0;
	sort(all(a));
	frv(i, 1, n + 1) {
		sum2 += pre[n] - pre[i] + (2 * i - n) * a[i] - pre[i - 1];
		trace(sum2)
	}
	// sum2 *= 2;
	cout << sum2 / (__gcd(sum2, n)) << " " << n / (__gcd(sum2, n));
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;
    return
        gcd(b,a%b);
}
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k,p,q,s,c,i,j;
    cin>>n;
    vector<ll> a(n);
    s=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a.begin(), a.end());
    p=0;q=0;
    for(i=0;i<n;i++)
    {
        p+=i*a[i]-q;
        q+=a[i];
    }
    ll ans;
    ans=s+2*p;
    k=gcd(ans,n);
    cout<<ans/k<<" "<<n/k;

    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
    #endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;
    return
        gcd(b,a%b);
}
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k,p,q,s,c,i,j;
    cin>>n;
    vector<ll> a(n);
    s=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a.begin(), a.end());
    p=0;q=0;
    for(i=0;i<n;i++)
    {
        p+=i*a[i]-q;
        q+=a[i];
    }
    ll ans=s+2*p;
    k=gcd(ans,n);
    cout<<ans/k<<" "<<n/k;

    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
    #endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;
    return
        gcd(b,a%b);
}
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    ll n,m,k,p,q,s,c,i,j;
    cin>>n;
    vector<ll> a(n);
    s=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a.begin(),a.end());
    p=0;q=0;
    for(i=0;i<n;i++)
        p+=i*a[i]-(n-i-1)*a[i];

    c=s+2*p;
    k=gcd(c,n);
    cout<<c/k<<" "<<n/k;

    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
    #endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;
    return
        gcd(b,a%b);
}
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k,p,q,s,c,i,j;
    cin>>n;
    vector<ll> a(n);
    s=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a.begin(), a.end());
    p=0;q=0;
    for(i=0;i<n;i++)
    {
        p+=i*a[i]-q;
        q+=a[i];
    }
    ll ans;
    ans=s+2*p;
    k=gcd(ans,n);
    cout<<ans/k<<" "<<n/k;

    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
    #endif
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
ll gcd(ll a, ll b)
{
    if(b == 0)
        return a;
    return
        gcd(b,a%b);
}
int main()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "rt", stdin);
        freopen("output.txt", "wt", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n,m,k,p,q,s,c,i,j;
    cin>>n;
    vector<ll> a(n);
    s=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        s+=a[i];
    }
    sort(a.begin(),a.end());
    p=0;q=0;
    for(i=0;i<n;i++)
        p+=i*a[i]-(n-i-1)*a[i];

    c=s+2*p;
    k=gcd(c,n);
    cout<<c/k<<" "<<n/k;

    #ifndef ONLINE_JUDGE
        cout<<"\nTime Elapsed : " << 1.0*clock() / CLOCKS_PER_SEC << " s\n";
    #endif
    return 0;
}


/* -*- coding: utf-8 -*-
 *
 * 0340C.cc: C. Tourist Problem
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

typedef long long ll;

/* global variables */

int as[MAX_N];
ll ass[MAX_N + 1];

/* subroutines */

template <typename T>
T gcd(T m, T n) {  // m > 0, n > 0
  if (m < n) swap(m, n);
  while (n > 0) {
    T r = m % n;
    m = n;
    n = r;
  }
  return m;
}

void reduce(ll &p, ll &q) {
  ll g = gcd<ll>(p, q);
  p /= g, q /= g;
}

/* main */

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) scanf("%d", as + i);
  sort(as, as + n);

  for (int i = 0; i < n; i++) ass[i + 1] = ass[i] + as[i];

  ll sum = 0;
  for (int i = 0; i < n; i++) {
    sum +=
      ass[n] - ass[i] - (ll)as[i] * (n - i) +
      (ll)as[i] * i - (ass[i] - ass[0]);
  }

  ll p = sum + ass[n], q = n;
  reduce(p, q);
  printf("%lld %lld\n", p, q);
  return 0;
}


/* -*- coding: utf-8 -*-
 *
 * 0340C.cc: C. Tourist Problem
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

typedef long long ll;

/* global variables */

int as[MAX_N];
ll ass[MAX_N + 1];

/* subroutines */

template <typename T>
T gcd(T m, T n) {  // m > 0, n > 0
  if (m < n) swap(m, n);
  while (n > 0) {
    T r = m % n;
    m = n;
    n = r;
  }
  return m;
}

void reduce(ll p, ll q) {
  ll g = gcd<ll>(p, q);
  p /= g, q /= g;
}

/* main */

int main() {
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);

  int n;
  scanf("%d", &n);

  for (int i = 0; i < n; i++) scanf("%d", as + i);
  sort(as, as + n);

  for (int i = 0; i < n; i++) ass[i + 1] = ass[i] + as[i];

  ll sum = 0;
  for (int i = 0; i < n; i++) {
    sum +=
      ass[n] - ass[i] - (ll)as[i] * (n - i) +
      (ll)as[i] * i - (ass[i] - ass[0]);
  }

  ll p = sum + ass[n], q = n;
  reduce(p, q);
  printf("%lld %lld\n", p, q);
  return 0;
}


#include<iostream>
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define M 1000000007
#define inarr(arr,n); for(ll i=0;i<n;i++) cin >> arr[i];
#define outarr(arr,n); for(ll i=0;i<n;i++) cout<<arr[i]<<" ";
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector <ll> a(n+1);
    ll sum_ele=0;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum_ele+=a[i];
    }
    a[0]=-1e15;
    sort(a.begin(),a.end());
    ll sum_pair=0;
    for(int i=n;i>=1;i--){
        sum_pair+=(2*i-n-1)*a[i];
    }
    sum_pair=sum_pair*2;
    ll sum=sum_ele+sum_pair;
    ll g=gcd(sum,n);
    cout<<sum/g<<" "<<n/g<<endl;
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define M 1000000007
#define inarr(arr,n); for(ll i=0;i<n;i++) cin >> arr[i];
#define outarr(arr,n); for(ll i=0;i<n;i++) cout<<arr[i]<<" ";
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    vector <ll> a(n+1);
    ll sum_ele=0;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum_ele+=a[i];
    }
    a[0]=-1e15;
    sort(a.begin(),a.end());
    ll sum_pair=0;
    for(int i=n;i>=1;i--){
        sum_pair+=(2*i-n-1)*a[i];
    }
    sum_pair=sum_pair*2;
    ll sum=sum_ele+sum_pair;
    ll g= __gcd(sum,n);
    cout<<sum/g<<" "<<n/g<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[100005] , pref[100005];
int main(){
    ll n , i , ans = 0;
    cin >> n;
    for(i = 1;i<=n;i++)
        cin >> a[i];
    sort(a + 1 , a + 1 + n);
    for(i = 1;i<=n;i++){
        ans+=a[i];
        pref[i] = pref[i - 1] + a[i];
    }
    for(i = 1;i<n;i++)
        ans+=2 * ( pref[n] - pref[i] - a[i] * (n - i) );
    cout << ans / __gcd(ans , n) << " " << n / __gcd(ans , n);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll a[100005] , pref[100005];
int main(){
    ll n , i , ans = 0;
    cin >> n;
    for(i = 1;i<=n;i++){
        cin >> a[i];
        ans+=a[i];
        pref[i] = pref[i - 1] + a[i];
    }
    for(i = 1;i<n;i++)
        ans+=2 * ( pref[n] - pref[i] - a[i] * (n - i) );
    cout << ans / __gcd(ans , n) << " " << n / __gcd(ans , n);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

#define int ll

int n;
vector<int> a;

void read() {
    cin >> n;
    a.resize(n);
    for (auto &i : a)
        cin >> i;
}

int ans1, ans2;

void run() {
    ans1 = 0;
    for (int i = 0; i < n; i++) {
        ans1 += a[i];
        for (int j = 0; j < n; j++) {
            ans1 += abs(a[i] - a[j]);
        }
    }
    ans2 = n;
    //cout << ans1 << " " << ans2 << endl;
    int g = __gcd(ans1, ans2);
    ans1 /= g;
    ans2 /= g;
}

void write() {
    cout << ans1 << " " << ans2 << endl;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    read();
    run();
    write();
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

#define int ll

int n;
vector<int> a;

void read() {
    cin >> n;
    a.resize(n);
    for (auto &i : a)
        cin >> i;
}

int ans1, ans2;

void run() {
    ans1 = 0;
    sort(all(a));
    for (auto i : a)
        ans1 += i;

    int sum = ans1;
    int now = 0;

    for (int i = 0; i < n; i++) {
        sum -= a[i];
        ans1 += sum - a[i] * (n - i - 1);
        ans1 += a[i] * i - now;
        now += a[i];
    }
    ans2 = n;
    //cout << ans1 << " " << ans2 << endl;
    int g = __gcd(ans1, ans2);
    ans1 /= g;
    ans2 /= g;
}

void write() {
    cout << ans1 << " " << ans2 << endl;
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    read();
    run();
    write();
    return 0;
}


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

#define ll long long
#define uint unsigned int
#define vi vector<int>
#define pii pair<int,int>

#define for0(i,n) for(int i=0; i<(n); i++)
#define for1(i,n) for(int i=1; i<=(n); i++)
#define from(i,a,b) for(int i=(a); i<=(b); i++)
#define forr(i,a,b) for(int i=(a); i>=(b); i--)

#define PB push_back
#define MP make_pair
#define FI first
#define SE second

#define all(x) (x).begin(),(x).end()
#define len(x) (int)(x).size()

#define safe_map unordered_map<long long, int, custom_hash>

#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main

void amax(int& x, int y){if(x<y)x=y;}
void amin(int& x, int y){if(x>y)x=y;}
int gcd(int a, int b){if(b){return gcd(b,a%b);}return a;}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {  // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);

    int n;cin>>n;
    int a[n], mul=2*n-1;
    ll sum=0;

    for0(i,n)
        cin >> a[i];
    sort(a,a+n,greater<int>());

    for0(i,n){
        sum += a[i]*mul;
        mul-=4;
    }
    mul = gcd(sum, n);
    cout << sum/mul << ' ' << n/mul << '\n';
}


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

#define ll long long
#define uint unsigned int
#define vi vector<int>
#define pii pair<int,int>

#define for0(i,n) for(int i=0; i<(n); i++)
#define for1(i,n) for(int i=1; i<=(n); i++)
#define from(i,a,b) for(int i=(a); i<=(b); i++)
#define forr(i,a,b) for(int i=(a); i>=(b); i--)

#define PB push_back
#define MP make_pair
#define FI first
#define SE second

#define all(x) (x).begin(),(x).end()
#define len(x) (int)(x).size()

#define safe_map unordered_map<long long, int, custom_hash>

#define CLK clock_t clk = clock();//Start of main
#define OCLK cerr << "Time (in ms): " << (double)(clock() - clk) * 1000.0 / CLOCKS_PER_SEC << '\n';//End of main

void amax(ll& x, ll y){if(x<y)x=y;}
void amin(ll& x, ll y){if(x>y)x=y;}
int gcd(ll a, ll b){if(b){return gcd(b,a%b);}return a;}

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {  // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);

    ll n;cin>>n;
    ll a[n], mul=2*n-1, sum=0;

    for0(i,n)
        cin >> a[i];
    sort(a,a+n,greater<int>());

    for0(i,n){
        sum += a[i]*mul;
        mul-=4;
    }
    mul = gcd(sum, n);
    cout << sum/mul << ' ' << n/mul << '\n';
}


/*
If you want to shine like a sun, first burn like a sun.
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int
#define ff first
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse
#define itr iterator
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/

int main()
{
    fast

///*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

    ll n;
    cin>>n;

    vl v(n);

    ll sum1 = 0,sum2 = 0;
    for(int i = 0; i < n; i++)
    {
        cin>>v[i];
        if(i)
        {
            sum1 = sum1 + i*(v[i]) - sum2;
        }
        sum2 += v[i];
    }

    ll num = 2*sum1 + sum2;
    ll den = n;

    ll gcd = __gcd(num,den);

    num = num/gcd;
    den = den/gcd;

    cout<<num<<" "<<den;

    return 0;
}


/*
If you want to shine like a sun, first burn like a sun.
*/

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define ll long long int
#define ld long double
#define vi vector<int>
#define vl vector<ll>
#define v2i vector<vector<int>>
#define v2l vector<vector<ll>>
#define ppi pair<int,int>
#define ppl pair<ll,ll>
#define vpi vector<ppi>
#define vpl vector<ppl>
#define all(x) x.begin(),x.end()
#define ii int,int
#define ff first
#define ss second
#define forn(i,a,b) for(int i=a;i<b;i++)
#define forr(i,a,b) for(int i=a;i>=b;i--)
#define forv(i,m) for(auto i : m)
#define imx INT_MAX
#define imn INT_MIN
#define inf 9000000000000000000
#define minf -inf
#define endl "\n"
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define sze size()
#define rvs reverse
#define itr iterator
#define pre cout<<fixed<<setprecision(10);
#define umap unordered_map
#define uset unordered_set
#define pi 3.141592653589793
#define MAXN 100005
#define test1(x) cout << #x " = " << x << endl;
#define test2(x,y) cout << #x " = " << x << " " << #y " = " << y << endl;
const ll infinity = 9e18;

/*
#define oset tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define MODM(a,b,md) ((a%md)*(b%md))%md
#define MODA(a,b,md) ((a%md)+(b%md))%md
#define ull unsigned long long int
*/

/*
bool compare(int a,int b) {return a > b;}
bool compare1(ppi a,ppi b) {return a.ff > b.ff;}
bool compare2(ppi a,ppi b) {return a.ss < b.ss;}
ll Npower(ll a,ll b) {ll product = 1; while(b){if(b&1){product = product*a;}a = a*a;b = b>>1;} return product;}
ll power(ll a,ll b,ll md) {ll product = 1; while(b){if(b&1){product = MODM(product,a,md);}a = MODM(a,a,md);b = b>>1;} return product%md;}
bool isprime(ll n){if(n < 2) return 0; ll i = 2; while(i*i <= n){if(n%i == 0) return 0; i++;} return 1;}
ll GCD(ll a,ll b) {return b==0 ? a:GCD(b,a%b);}
ll LCM(ll a,ll b) {return (a/GCD(a,b))*b; }
*/

int main()
{
    fast

///*
    #ifndef ONLINE_JUDGE
        freopen("input.txt",  "r",  stdin);
        freopen("output.txt", "w", stdout);
    #endif
//*/

    ll n;
    cin>>n;

    vl v(n);

    ll sum1 = 0,sum2 = 0;
    for(int i = 0; i < n; i++)
    {
        cin>>v[i];
    }

    sort(all(v));

    for(int i = 0; i < n; i++)
    {
        if(i)
        {
            sum1 = sum1 + i*(v[i]) - sum2;
        }
        sum2 += v[i];
    }

    ll num = 2*sum1 + sum2;
    ll den = n;

    ll gcd = __gcd(num,den);

    num = num/gcd;
    den = den/gcd;

    cout<<num<<" "<<den;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;
const int mod = 1e9+7;

long long gcd(long long a, long long b){
  if(b == 0) return a;
  gcd(b, a%b);
}
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n; cin >> n;
  vector<int> a(n+1), b(n);
  for(int i = 0; i < n; i++)
    cin >> a[i];
  sort(a.begin(), a.end());
  for(int i = 0; i < n; i++)
    b[i] = a[i+1] - a[i];
  long long s = 0;
  for(int i = 0; i < n; i++)
    s += 1LL * (n-i) * (2*i+1) * b[i];
  cout << s/gcd(s, 1LL * n) << ' ' << n/gcd(s, 1LL * n) << endl;
}


#include <bits/stdc++.h>

using namespace std;
const int mod = 1e9+7;

int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n; cin >> n;
  vector<int> a(n+1), b(n);
  for(int i = 0; i < n; i++)
    cin >> a[i];
  sort(a.begin(), a.end());
  for(int i = 0; i < n; i++)
    b[i] = a[i+1] - a[i];
  long long s = 0;
  for(int i = 0; i < n; i++)
    s += 1LL * (n-i) * (2*i+1) * b[i];
  cout << s << ' ' << n << endl;
}


#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long denom = n;
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    numer += a[i];
    for (int j = i; j < n; ++j) {
      numer += abs(a[j] - a[i]) * 2;
    }
  }
  long long d = gcd(numer, denom);
  cout << numer / d << " " << denom / d << endl;
  return 0;
}


#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long numer = 0;
  long long denom = n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      numer += llabs(a[j] - a[i]) * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    numer += a[i];
  }
  long long g = gcd(numer, denom);
  cout << numer / g << " " << denom / g << endl;
  return 0;
}


#include <iostream>
using namespace std;
int n, a[10001];
long long fact(int f) {
  if (f < 1) {
    return 1;
  }
  return f * fact(f - 1);
}
int gcd(int a, int b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int num = 0;
  int f = fact(n - 1);
  int den = f * n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      num += (a[j] - a[i]) * f * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    num += a[i] * f;
  }
  int g = gcd(num, den);
  cout << num / g << den / g << endl;
  return 0;
}


#include <cmath>
#include <iostream>
using namespace std;
int n, a[10001];
long long fact(int f) {
  if (f < 1) {
    return 1;
  }
  return f * fact(f - 1);
}
int gcd(int a, int b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int nu = 0;
  int f = fact(n - 1);
  int de = f * n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      nu += abs(a[j] - a[i]) * f * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    nu += a[i] * f;
  }
  int g = gcd(nu, de);
  cout << nu / g << " " << de / g << endl;
  return 0;
}


#include <cmath>
#include <iostream>
using namespace std;
int n, a[10001];
long long fact(int f) {
  if (f < 1) {
    return 1;
  }
  return f * fact(f - 1);
}
long long gcd(long long a, long long b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long numer = 0;
  long long f = fact(n - 1);
  long long denom = f * n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      numer += abs(a[j] - a[i]) * f * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    numer += a[i] * f;
  }
  long long g = gcd(numer, denom);
  cout << numer / g << " " << denom / g << endl;
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cstdlib>
using namespace std;
int n, a[100001];
inline long long gcd(long long a, long long b) {
  long long r = 0;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  scanf("%d", &n);
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    numer += a[i];
    for (int j = 0; j < i; ++j) {
      numer += abs(a[i] - a[j]) * 2;
    }
  }
  long long d = gcd(numer, n);
  printf("%lld %lld\n", numer / d, n / d);
  return 0;
}


#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    numer += a[i];
    for (int j = 0; j < i; ++j) {
      numer += abs(a[i] - a[j]) * 2;
    }
  }
  long long d = gcd(numer, n);
  cout << numer / d << " " << n / d << endl;
  return 0;
}


#include <iostream>
using namespace std;
int n, a[10001];
long long fact(int f) {
  if (f < 1) {
    return 1;
  }
  return f * fact(f - 1);
}
int gcd(int a, int b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int num = 0;
  int f = fact(n - 1);
  int den = f * n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      num += (a[j] - a[i]) * f * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    num += a[i] * f;
  }
  int g = gcd(num, den);
  cout << num / g << " " << den / g << endl;
  return 0;
}


#include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  long long r = 0;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    numer += a[i] + (a[i] * i - a[n - i - 1] * i) * 2;
  }
  long long d = gcd(numer, n);
  cout << numer / d << " " << n / d << endl;
  return 0;
}


#include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  long long r = 0;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    numer += a[i] + ((long long)a[i] * i - (long long)a[n - i - 1] * i) * 2;
  }
  long long d = gcd(numer, n);
  cout << numer / d << " " << n / d << endl;
  return 0;
}


#include <iostream>
using namespace std;
int n, a[10001];
long long fact(int f) {
  if (f < 1) {
    return 1;
  }
  return f * fact(f - 1);
}
int gcd(int a, int b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int num = 0;
  int f = fact(n - 1);
  int den = f * n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      num += (a[j] - a[i]) * f * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    num += a[i] * f;
  }
  int g = gcd(num, den);
  cout << num / g << "/" << den / g << endl;
  return 0;
}


#include <cmath>
#include <iostream>
using namespace std;
int n, a[10001];
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  long long numer = 0;
  long long denom = n;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      numer += abs(a[j] - a[i]) * 2;
    }
  }
  for (int i = 0; i < n; ++i) {
    numer += a[i];
  }
  long long g = gcd(numer, denom);
  cout << numer / g << " " << denom / g << endl;
  return 0;
}


#include <algorithm>
#include <cstdlib>
#include <iostream>
using namespace std;
int n, a[100001];
long long gcd(long long a, long long b) {
  long long r = 0;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long numer = 0;
  for (int i = 0; i < n; ++i) {
    numer += a[i] + (long long)(a[i] * i - a[n - i - 1] * i) * 2;
  }
  long long d = gcd(numer, n);
  cout << numer / d << " " << n / d << endl;
  return 0;
}


/*****************/
/*

Sharma Ji Ka Ladka
MNNIT Allahabad

*/
/*****************/

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

#define For(i, a, b) for (int i = a; i < b; i++)
#define Forl(i, size) for (int i = 0; i < size; i++)
#define Forr(i, size) for (int i = size - 1; i >= 0; i--)
#define ForR(i, a, b) for (int i = a; i >= b; i--)
#define s(n) scanf("%d", &n)
#define p(n) printf("%d\n", n)
#define ps(n) printf("%s\n", n)
#define sd(n) \
    int n;    \
    scanf("%d", &n)
#define sl(n)        \
    long long int n; \
    scanf("%lld", &n)
#define pb(n) push_back(n)
#define clr(a) memset(a, 0, sizeof(a))
#define all(c) (c).begin(), (c).end()
#define len length()
#define size size()
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
typedef __int64 ull;
#define ret return 0;
#define PI 3.14159265
#define snuke(c, itr) for (__typeof((c).begin()) itr = (c).begin(); itr != (c).end(); itr++)
#define boost                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
const long long Mod = 1e9 + 7;
// string a,b,s,c,d;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vst;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
ll sum = 0, ans = 0, res = 0;
int i, j, k;

vector<string> vec_splitter(string s)
{
    s += ',';
    vector<string> res;
    while (!s.empty())
    {
        res.push_back(s.substr(0, s.find(',')));
        s = s.substr(s.find(',') + 1);
    }
    return res;
}
void debug_out(vector<string> __attribute__((unused)) args, __attribute__((unused)) int idx) { cerr << endl; }
void debug_out(
    vector<string> __attribute__((unused)) args,
    __attribute__((unused)) int idx,
    __attribute__((unused)) int LINE_NUM) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T)
{
    if (idx > 0)
        cerr << ", ";
    else
        cerr << "Line(" << LINE_NUM << ") ";
    stringstream ss;
    ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, LINE_NUM, T...);
}
#define watch(x) cout << (#x) << " is " << (x) << endl;
/*************************************************/
//Comment down this line to hide debugging output;

#define XOX

//Uncomment above line to show debugging output
/************************************************/
#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif

bool sortbysec(const pair<int, int> &a,
               const pair<int, int> &b)
{
    if (a.se == b.se)
        return (a.fi < b.fi);

    return (a.se < b.se);
}

// IS PRIME FUNCTION STARTS

bool isPrime(ll num)
{
    bool flag = true;
    if (num == 1)
        return false;
    for (int i = 2; i <= sqrt(num); i++)
    {
        if (num % i == 0)
        {
            flag = false;
            break;
        }
    }
    return flag;
}

//IS PRIME FUNCTION ENDS

//**Array Sum Function**

ll findSum(ll a[], int l, int r)
{
    ll sum = 0;
    For(i, l, r)
    {
        sum += a[i];
    }
    return sum;
}

//**Array Sum Function Ends**

//Prime Factors Of A Number

vector<pair<int, int>> vec1; //Prime Factors along with their exponents
void primeFactors(ll n)
{
    int c1 = 0;
    // Print the number of 2s that divide n
    while (n % 2 == 0)
    {
        // printf("%d ", 2);
        n = n / 2;
        c1++;
    }
    if (c1)
        vec1.pb(mp(2, c1));
    c1 = 0;
    // n must be odd at this point. So we can skip
    // one element (Note i = i +2)
    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        c1 = 0;
        // While i divides n, print i and divide n
        while (n % i == 0)
        {
            // printf("%d ", i);

            n = n / i;
            c1++;
        }
        if (c1)
            vec1.pb(mp(i, c1));
    }
    c1 = 0;
    // This condition is to handle the case when n
    // is a prime number greater than 2
    if (n > 2)
        vec1.pb(mp(n, 1));
}

//Ends

//*** Power Function Starts
ll power(int x, unsigned int y)
{
    int temp;
    if (y == 0)
        return 1;
    temp = power(x, y / 2);
    if (y % 2 == 0)
        return temp * temp;
    else
        return x * temp * temp;
}
//*** Power function ends

//nCr function starts

ull nCr(ll n, ll r)
{
    ull p = 1;
    ull k = 1;
    if (n - r < r)
        r = n - r;

    if (r != 0)
    {
        while (r)
        {
            p *= n;
            k *= r;
            ll m = __gcd(p, k);
            p /= m;
            k /= m; //Simplifying
            n--;
            r--;
        }
    }
    else
        p = 1;

    return p;
}

//nCr function ends

// ** LCM of two numbers
ll lcm(ll a, ll b)
{
    return a / __gcd(a, b) * b;
}
//** Ends //

//** Count Set Bits Functon

unsigned int countBits(ll n, int specify)
{
    unsigned int count = 0, total = 0;
    if (n == 0)
    {
        if (specify == 1)
            return 0;
        else
            return 1;
    }
    while (n)
    {
        total += 1;
        count += n & 1;
        n >>= 1;
    }
    if (specify == 1)
        return count;
    else
        return (total - count);
}

//** Ends //

//Array Scanner starts

void scar(ll a[], int n)
{
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
}

//Array Scanner ends
//  long long findTargetSumWays(vector<int>& vec, int S) {

//         long long sum=0;
//         for(int i=0;i<vec.size;i++)
//         {
//             sum+=vec[i];
//         }
//         // cout<<sum<<endl;
//         if(sum<S||(sum+S)%2!=0)return 0;
//         long long s1=(sum+S)/2;

//         long long dp[vec.size+10][s1+10]={0};
//         for(int j=0;j<s1+1;j++)
//         {
//             dp[0][j]=0;
//         }
//         for(int i=0;i<vec.size+1;i++)
//         {
//             dp[i][0]=1;
//         }
//         for(i=1;i<vec.size+1;i++)
//         {
//             For(j,0,s1+1)
//             {if(j>=vec[i-1])
//                 dp[i][j]=dp[i-1][j]+dp[i-1][j-vec[i-1]];
//                 else
//                 {
//                     dp[i][j]=dp[i-1][j];
//                 }

//             }
//         }
//         return dp[vec.size][s1];

//     }

signed main()
{
    // boost

    // TO Enable Debugging Or Disable Debuuging Go To Line "73";
    string aux1, aux2, aux3;

    ll T = 1;

    // cin>>T;

    For(ZA, 1, T + 1)
    {

        int f = 0, fl1 = 0, fl2 = 0, c1 = 0, c2 = 0, cont = 0, cnt = 0, c3 = 0, auxi = 0, auxj = 0;
        ll mi = INT_MAX;
        ll ma = INT_MIN, sol = 0;
        sum = 0;
        ll sumBfr = 0;
        int n;
        cin >> n;
        ll a[n];
        For(i, 0, n)
        {
            cin >> a[i];sum+=a[i];
        }
        sort(a,a+n);
        ll sumLeft=0;
        For(i,0,n)
        {
          sumLeft+=(a[i]*i)-sumBfr;
          sumBfr+=a[i];
        }
        ll total=sum+2*sumLeft;
        ll ooo=__gcd(total,(ll)n);
        cout<<(total/ooo)<<" "<<(n/ooo)<<endl;

    }

    return 0;
}