#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
const ll INF = 1e12 + 5;
const int N = 2e5;

int n, T;
ll a[N], b[N];

bool check(ll x)
{
    priority_queue< pair<ll,pll> > Q;
    for (int i = 0; i < n; ++i)
        Q.push({-(a[i] / b[i]), {a[i], b[i]}});

    for (int t = 0; t < T; ++t)
    {
        pair<ll,pll> e = Q.top();
        Q.pop();
        static ll a, b;
        a = e.second.first;
        b = e.second.second;
        if (a < t * b)
            return false;
        a += x;
        Q.push({-(a / b), {a, b}});
    }

    return true;
}

int main()
{
    scanf("%d%d", &n, &T);

    for (ll *it = a, *e = a + n; it != e; ++it)
        scanf("%lld", it);
    for (ll *it = b, *e = b + n; it != e; ++it)
        scanf("%lld", it);

    ll l = -1, r = INF, m;
    while(r - l > 1)
    {
        m = (l + r) / 2;
        if (check(m))
            r = m;
        else
            l = m;
    }

    if (r == INF)
        printf("-1");
    else
        printf("%lld", r);
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <cstring>
#include<string>
#include <unordered_map>
#include <queue>
#include <complex>
#include<map>
#include<deque>
#include <cstdio>
#include <cstdlib>
#include <utility>
#include <cmath>
#include<random>
#include <cassert>
#include <unordered_set>
#include<ctime>
#include <queue>
//#pragma once
#define VERSION "0.1.4"

#include <cassert>
#include <cstdio>
#include <algorithm>

/** Fast allocation */

int allocator_pos = 0;
char allocator_memory[(int)4e7];
inline void * operator new (size_t n) {
	char *res = allocator_memory + allocator_pos;
	allocator_pos += n;
	//assert(allocator_pos <= (int)FAST_ALLOCATOR_MEMORY);
	return (void *)res;
}
inline void operator delete (void *) noexcept { }

template <class T = long long> inline T readInt();
inline double readDouble();
inline long long readUInt();
inline int readChar(); // first non-blank character
inline void readWord(char *s);
inline bool readLine(char *s); // do not save '\n'
inline bool isEof();
inline int getChar();
inline int peekChar();
inline bool seekEof();
inline void skipBlanks();

template <class T> inline void writeInt(T x, char end = 0, int len = -1);
inline void writeChar(int x);
inline void writeWord(const char *s);
inline void writeDouble(double x, int len = 0);
inline void flush();

static struct buffer_flusher_t {
	~buffer_flusher_t() {
		flush();
	}
} buffer_flusher;

/** Read */

static const int buf_size = 4096;

static unsigned char buf[buf_size];
static int buf_len = 0, buf_pos = 0;

inline bool isEof() {
	if (buf_pos == buf_len) {
		buf_pos = 0, buf_len = fread(buf, 1, buf_size, stdin);
		if (buf_pos == buf_len)
			return 1;
	}
	return 0;
}

inline int getChar() {
	return isEof() ? -1 : buf[buf_pos++];
}

inline int peekChar() {
	return isEof() ? -1 : buf[buf_pos];
}

inline bool seekEof() {
	int c;
	while ((c = peekChar()) != -1 && c <= 32)
		buf_pos++;
	return c == -1;
}

inline void skipBlanks() {
	while (!isEof() && buf[buf_pos] <= 32U)
		buf_pos++;
}

inline int readChar() {
	int c = getChar();
	while (c != -1 && c <= 32)
		c = getChar();
	return c;
}

inline long long readUInt() {
	int c = readChar(), x = 0;
	while ('0' <= c && c <= '9')
		x = x * 10 + c - '0', c = getChar();
	return x;
}

template <class T>
inline T readInt() {
	int s = 1, c = readChar();
	T x = 0;
	if (c == '-')
		s = -1, c = getChar();
	else if (c == '+')
		c = getChar();
	while ('0' <= c && c <= '9')
		x = x * 10 + c - '0', c = getChar();
	return s == 1 ? x : -x;
}

inline double readDouble() {
	int s = 1, c = readChar();
	double x = 0;
	if (c == '-')
		s = -1, c = getChar();
	while ('0' <= c && c <= '9')
		x = x * 10 + c - '0', c = getChar();
	if (c == '.') {
		c = getChar();
		double coef = 1;
		while ('0' <= c && c <= '9')
			x += (c - '0') * (coef *= 1e-1), c = getChar();
	}
	return s == 1 ? x : -x;
}

inline void readWord(char *s) {
	int c = readChar();
	while (c > 32)
		*s++ = c, c = getChar();
	*s = 0;
}

inline bool readLine(char *s) {
	int c = getChar();
	while (c != '\n' && c != -1)
		*s++ = c, c = getChar();
	*s = 0;
	return c != -1;
}

/** Write */

static int write_buf_pos = 0;
static char write_buf[buf_size];

inline void writeChar(int x) {
	if (write_buf_pos == buf_size)
		fwrite(write_buf, 1, buf_size, stdout), write_buf_pos = 0;
	write_buf[write_buf_pos++] = x;
}

inline void flush() {
	if (write_buf_pos)
		fwrite(write_buf, 1, write_buf_pos, stdout), write_buf_pos = 0;
}

template <class T>
inline void writeInt(T x, char end, int output_len) {
	if (x < 0)
		writeChar('-'), x = -x;

	char s[24];
	int n = 0;
	while (x || !n)
		s[n++] = '0' + x % 10, x /= 10;
	while (n < output_len)
		s[n++] = '0';
	while (n--)
		writeChar(s[n]);
	if (end)
		writeChar(end);
}

inline void writeWord(const char *s) {
	while (*s)
		writeChar(*s++);
}

inline void writeDouble(double x, int output_len) {
	if (x < 0)
		writeChar('-'), x = -x;
	int t = (int)x;
	writeInt(t), x -= t;
	writeChar('.');
	for (int i = output_len - 1; i > 0; i--) {
		x *= 10;
		t = std::min(9, (int)x);
		writeChar('0' + t), x -= t;
	}
	x *= 10;
	t = std::min(9, (int)(x + 0.5));
	writeChar('0' + t);
}

using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
const ll INF = 1e12 + 5;
const int N = 2e5;

int n, T;
ll a[N], b[N];

ll calc(ll a, ll b)
{
    return a / b;
}
bool check(ll x)
{
    priority_queue< pair<ll,pll> > Q;
    for (int i = 0; i < n; ++i)
        Q.push({-calc(a[i], b[i]), {a[i], b[i]}});

    for (int t = 0; t < T; ++t)
    {
        auto e = Q.top();
        Q.pop();
        static ll a, b;
        a = e.second.first;
        b = e.second.second;
        if (a - t * b < 0)
            return false;
        a += x;
        Q.push({-calc(a, b), {a, b}});
    }

    return true;
}

int main()
{

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    cin >> n >> T;

    for (int i = 0; i < n; ++i)
        cin >> a[i];
    for (int i = 0; i < n; ++i)
        cin >> b[i];

    ll l = -1, r = INF, m;
    while(r - l > 1)
    {
        m = (l + r) / 2;
        if (check(m))
            r = m;
        else
            l = m;
    }

    if (r == INF)
        writeInt(-1);
    else
        writeInt(r);
}


#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;

typedef long long ll;

/*<-------------------------------------------------------------->*/

#include <cassert>
#include <cstdio>

/** Interface */

inline ll readInt();
inline int readUInt();
inline void readWord( char *s );
inline int fast_readchar(); // you may use readchar() instead of it

inline void writeInt( int x );
inline void fast_writechar( int x ); // you may use putchar() instead of it
inline void writeWord( const char *s );
inline void fast_flush();

/** Read */

static const int buf_size = 4096;

inline int fast_readchar() {
  static char buf[buf_size];
  static int len = 0, pos = 0;
  if (pos == len)
    pos = 0, len = fread(buf, 1, buf_size, stdin);
  if (pos == len)
    return -1;
  return buf[pos++];
}

inline int readUInt() {
  int c = fast_readchar(), x = 0;
  while (c <= 32)
    c = fast_readchar();
  while ('0' <= c && c <= '9')
    x = x * 10 + c - '0', c = fast_readchar();
  return x;
}

inline ll readInt() {
  int s = 1, c = fast_readchar();
  ll x = 0;
  while (c <= 32)
    c = fast_readchar();
  if (c == '-')
    s = -1, c = fast_readchar();
  while ('0' <= c && c <= '9')
    x = x * 10 + c - '0', c = fast_readchar();
  return x * s;
}

inline void readWord( char *s ) {
  int c = fast_readchar();
  while (c <= 32)
    c = fast_readchar();
  while (c > 32)
    *s++ = c, c = fast_readchar();
  *s = 0;
}

/** Write */

static int write_pos = 0;
static char write_buf[buf_size];

inline void fast_writechar( int x ) {
  if (write_pos == buf_size)
    fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
  write_buf[write_pos++] = x;
}

inline void fast_flush() {
  if (write_pos)
    fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
}

inline void writeInt( ll x ) {
  if (x < 0)
    fast_writechar('-'), x = -x;

  char s[24];
  int n = 0;
  while (x || !n)
    s[n++] = '0' + x % 10, x /= 10;
  while (n--)
    fast_writechar(s[n]);
}

inline void writeWord( const char *s ) {
  while (*s)
    fast_writechar(*s++);
}

/*<-------------------------------------------------------------->*/

typedef pair<ll,ll> pll;
const ll INF = 2e12 + 5;
const int N = 2e5;

int n, T;
ll a[N], b[N];

ll calc(ll a, ll b)
{
    return a / b;
}
bool check(ll x)
{
    priority_queue< pair<ll,pll> > Q;
    for (int i = 0; i < n; ++i)
        Q.push({-calc(a[i], b[i]), {a[i], b[i]}});

    for (int t = 0; t < T; ++t)
    {
        auto e = Q.top();
        Q.pop();
        static ll a, b;
        a = e.second.first;
        b = e.second.second;
        if (a - b * t < 0)
            return false;
        a += x;
        Q.push({-calc(a, b), {a, b}});
    }

    return true;
}

int main()
{

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

    n = readInt();
    T = readInt();

    for (ll *it = a, *e = a + n; it != e; ++it)
        *it = readInt();
    for (ll *it = b, *e = b + n; it != e; ++it)
        *it = readInt();

    ll l = -1, r = INF, m;
    while(r - l > 1)
    {
        m = (l + r) / 2;
        if (check(m))
            r = m;
        else
            l = m;
    }

    if (r == INF)
        writeInt(-1LL);
    else
        writeInt(r);

    fast_flush();
}


#include <cassert>
#include <cstdio>

/** Interface */

inline int readInt();
inline int readUInt();
inline void readWord( char *s );
inline int fast_readchar(); // you may use readchar() instead of it

inline void writeInt( int x );
inline void fast_writechar( int x ); // you may use putchar() instead of it
inline void writeWord( const char *s );
inline void fast_flush();

/** Read */

static const int buf_size = 4096;

inline int fast_readchar() {
  static char buf[buf_size];
  static int len = 0, pos = 0;
  if (pos == len)
    pos = 0, len = fread(buf, 1, buf_size, stdin);
  if (pos == len)
    return -1;
  return buf[pos++];
}

inline int readUInt() {
  int c = fast_readchar(), x = 0;
  while (c <= 32)
    c = fast_readchar();
  while ('0' <= c && c <= '9')
    x = x * 10 + c - '0', c = fast_readchar();
  return x;
}

inline int readInt() {
  int s = 1, c = fast_readchar();
  int x = 0;
  while (c <= 32)
    c = fast_readchar();
  if (c == '-')
    s = -1, c = fast_readchar();
  while ('0' <= c && c <= '9')
    x = x * 10 + c - '0', c = fast_readchar();
  return x * s;
}

inline void readWord( char *s ) {
  int c = fast_readchar();
  while (c <= 32)
    c = fast_readchar();
  while (c > 32)
    *s++ = c, c = fast_readchar();
  *s = 0;
}

/** Write */

static int write_pos = 0;
static char write_buf[buf_size];

inline void fast_writechar( int x ) {
  if (write_pos == buf_size)
    fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
  write_buf[write_pos++] = x;
}

inline void fast_flush() {
  if (write_pos)
    fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
}

inline void writeInt( int x ) {
  if (x < 0)
    fast_writechar('-'), x = -x;

  char s[24];
  int n = 0;
  while (x || !n)
    s[n++] = '0' + x % 10, x /= 10;
  while (n--)
    fast_writechar(s[n]);
}

inline void writeWord( const char *s ) {
  while (*s)
    fast_writechar(*s++);
}

#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
const ll INF = 2e12 + 5;
const int N = 2e5;

int n, T;
ll a[N], b[N];

ll calc(ll a, ll b)
{
    return a / b;
}
bool check(ll x)
{
    priority_queue< pair<ll,pll> > Q;
    for (int i = 0; i < n; ++i)
        Q.push({-calc(a[i], b[i]), {a[i], b[i]}});

    for (int t = 0; t < T; ++t)
    {
        auto e = Q.top();
        Q.pop();
        static ll a, b;
        a = e.second.first;
        b = e.second.second;
        if (a - t * b < 0)
            return false;
        a += x;
        Q.push({-calc(a, b), {a, b}});
    }

    return true;
}

int main()
{
    n = readInt();
    T = readInt();

    for (ll *it = a, *e = a + n; it != e; ++it)
        *it = readInt();
    for (ll *it = b, *e = b + n; it != e; ++it)
        *it = readInt();

    ll l = -1, r = INF, m;
    while(r - l > 1)
    {
        m = (l + r) / 2;
        if (check(m))
            r = m;
        else
            l = m;
    }

    if (r == INF)
        writeInt(-1);
    else
        writeInt(r);

    fast_flush();
}


#include <iostream>
#include <cstdio>
#include <queue>
using namespace std;

typedef long long ll;
typedef pair<ll,ll> pll;
const ll INF = 1e12 + 5;
const int N = 2e5;

int n, T;
ll a[N], b[N];

ll calc(ll a, ll b)
{
    return a / b;
}
bool check(ll x)
{
    priority_queue< pair<ll,pll> > Q;
    for (int i = 0; i < n; ++i)
        Q.push({-calc(a[i], b[i]), {a[i], b[i]}});

    for (int t = 0; t < T; ++t)
    {
        auto e = Q.top();
        Q.pop();
        static ll a, b;
        a = e.second.first;
        b = e.second.second;
        if (a - t * b < 0)
            return false;
        a += x;
        Q.push({-calc(a, b), {a, b}});
    }

    return true;
}

int main()
{

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

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

    for (ll* it = a, e = a + n; it != e; ++it)
        scanf("%lld", it);
    for (ll* it = b, e = b + n; it != e; ++it)
        scanf("%lld", it);

    ll l = -1, r = INF, m;
    while(r - l > 1)
    {
        m = (l + r) / 2;
        if (check(m))
            r = m;
        else
            l = m;
    }

    if (r == INF)
        printf("-1");
    else
        printf("%lld", r);
}


#include <iostream>
#include <vector>
#include <string>

#include <map>
#include <set>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

int n;
vector<int> v;

int gcd(int a, int b){
    if (a == 0) return b;
    return gcd(b%a, a);
}

void input(){
    cin >> n;
    int a;
    for(int i = 0; i < n; ++i){
        cin >> a;
        v.push_back(a);
    }

}

int ans1, ans2;

void solve(){
    int chisl1 = 0;
    sort(v.begin(), v.end());
    for(int i = 0; i < n; ++i) {
        chisl1 += v[i];
    }
    int znam1 = n;

    int now1 = chisl1, now2 = 0;

    int chisl2 = 0;

    for(int i = 0; i < n; ++i) {
        now1 -= (n-i)*(v[i] - now2);
        now2 = v[i];
        chisl2 += now1;
    }
    int znam2 = n-2;
    chisl2*=2;

    int chisl = chisl1 + chisl2;
    int znam = n;
    ans1 = chisl / gcd(chisl, znam);
    ans2 = znam / gcd(chisl, znam);

}

void output(){
    cout << ans1 << ' ' << ans2;
}

int main(){
    input();
    solve();
    output();
    return 0;
}


#include <iostream>
#include <vector>
#include <string>

#include <map>
#include <set>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

long long n;
vector<long long> v;

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

void input(){
    cin >> n;
    long long a;
    for(long long i = 0; i < n; ++i){
        cin >> a;
        v.push_back(a);
    }

}

long long ans1, ans2;

void solve(){
    long long chisl1 = 0;
    sort(v.begin(), v.end());
    for(long long i = 0; i < n; ++i) {
        chisl1 += v[i];
    }
    long long znam1 = n;

    long long now1 = chisl1, now2 = 0;

    long long chisl2 = 0;

    for(long long i = 0; i < n; ++i) {
        now1 -= (n-i)*(v[i] - now2);
        now2 = v[i];
        chisl2 += now1;
    }
    long long znam2 = n-2;
    chisl2*=2;

    long long chisl = chisl1 + chisl2;
    long long znam = n;
    ans1 = chisl / gcd(chisl, znam);
    ans2 = znam / gcd(chisl, znam);

}

void output(){
    cout << ans1 << ' ' << ans2;
}

int main(){
    input();
    solve();
    output();
    return 0;
}


#include <stdio.h>
#include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <complex>

using namespace std;

#define file "integer"
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;

const int MAXN = 1e5+5;
const double EPS = 1e-15;
const ll INF = 1000000000+5;
const int MAXN2 = 40+5;

ll a[MAXN];
ll s[MAXN];

ll gcd(ll a,ll b)
{
	if(b==0) return a;
	else return gcd(b,a%b);
}

int main()
{
	//freopen(file".in","r",stdin); freopen(file".out","w",stdout);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%I64d",&a[i]);

	}

	ll num = 0,den = n;
	sort(a,a+n);
	for(int i=0;i<n;i++)
	{
		s[i] = a[i];
		if(i) s[i]+=s[i-1];
	}

	ll cur;
	for(int i=n-1;i>=0;i--)
	{
		cur = a[i]*i;
		if(i) cur-=s[i-1];

		num+=cur;

	}

	num*=2;
	num+=s[n-1];
	ll g = gcd(num,den);
	num/=g;
	den/=g;
	printf("%I64d %I64d",num,den);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
using namespace std;

long long gcd(long long a, long long b)
{
    while(b)
    {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long a[100005];

int main()
{
    long long n;
    scanf("%I64d", &n);

    for(int i = 0; i < n; i++)
        scanf("%I64d",&a[i]);

    sort(a, a+n);

    long long rch = 0, rzn = 0;

    long long sa = 0;

    for(int i = 0; i < n; i++)
        sa += a[i];

    long long s = 0, tmp = 0;
    for(int i = 1; i < n; i++)
    {
        s += (a[i] - a[0]) * i - tmp;
        tmp += a[i] - a[0];
    }

    rch = s*4 + (n-1) * sa;
    rzn = n*(n-1);

    long long nd = gcd(rch, rzn);

    printf("%I64d %I64d\n", rch / nd, rzn / nd);

    return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<set>
#include<stack>
using namespace std;

long long gcd(long long a, long long b)
{
    while(b)
    {
        a %= b;
        swap(a, b);
    }
    return a;
}

long long a[100005];

int main()
{
    long long n;
    scanf("%I64d", &n);

    for(int i = 0; i < n; i++)
        scanf("%I64d",&a[i]);

    sort(a, a+n);

    long long rch = 0, rzn = 0;

    long long sa = 0;

    for(int i = 0; i < n; i++)
        sa += a[i];

    long long s = 0, tmp = 0;
    for(int i = 1; i < n; i++)
    {
        s += (a[i] - a[0]) * i - tmp;
        tmp += a[i] - a[0];
    }

    rch = 2*s + sa;
    rzn = n;

    long long nd = gcd(rch, rzn);

    printf("%I64d %I64d\n", rch / nd, rzn / nd);

    return 0;
}


#ifdef NALP_PROJECT
#pragma hdrstop
#else
#define _SECURE_SCL 0
#endif

#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <utility>
#include <cassert>

#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <bitset>
#include <memory.h>

#include <iostream>
#include <fstream>
#include <sstream>

using namespace std;

typedef long long int64;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define y1 YYY1
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#ifdef _WIN32
	#define LLD "%I64d"
#else
	#define LLD "%lld"
#endif

template<typename T> inline T Abs(T x) { return (x >= 0) ? x : -x; }
template<typename T> inline T sqr(T x) { return x * x; }
template<typename T> inline string toStr(T x) { stringstream st; st << x; string s; st >> s; return s; }
template<typename T> inline int bit(T mask, int b) { return (b >= 0 && (mask & (T(1) << b)) != 0) ? 1 : 0; }

inline int nextInt() { int x; if (scanf("%d", &x) != 1) throw; return x; }
inline int64 nextInt64() { int64 x; if (scanf(LLD, &x) != 1) throw; return x; }
inline double nextDouble() { double x; if (scanf("%lf", &x) != 1) throw; return x; }

const int INF = (int)1E9;
const int64 INF64 = (int64)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;

const int MAXN = 200100;

int64 gcd(int64 a, int64 b) {
	if (min(a, b) == 0) return a + b;
	return gcd(b % a, a);
}

int64 a[MAXN];
int n;

int main() {
#ifdef NALP_PROJECT
	freopen("input.txt", "rt", stdin);
//	freopen("output.txt", "wt", stdout);
#else
#endif

	n = nextInt();
	forn(i, n)
		a[i] = nextInt();
	sort(a, a + n);

	int64 ans = 0;
	forn(i, n)
		ans += a[i];

	forn(i, n - 1)
		ans += (a[i + 1] - a[i]) * (i + 1) * (n - i - 1) * 2;

	int64 z = n, g = gcd(ans, z);
	cout << ans/g << " " << z/g << endl;

	return 0;
}


#ifdef NALP_PROJECT
#pragma hdrstop
#else
#define _SECURE_SCL 0
#endif

#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <utility>
#include <cassert>

#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <bitset>
#include <memory.h>

#include <iostream>
#include <fstream>
#include <sstream>

using namespace std;

typedef long long int64;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define y1 YYY1
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#ifdef _WIN32
	#define LLD "%I64d"
#else
	#define LLD "%lld"
#endif

template<typename T> inline T Abs(T x) { return (x >= 0) ? x : -x; }
template<typename T> inline T sqr(T x) { return x * x; }
template<typename T> inline string toStr(T x) { stringstream st; st << x; string s; st >> s; return s; }
template<typename T> inline int bit(T mask, int b) { return (b >= 0 && (mask & (T(1) << b)) != 0) ? 1 : 0; }

inline int nextInt() { int x; if (scanf("%d", &x) != 1) throw; return x; }
inline int64 nextInt64() { int64 x; if (scanf(LLD, &x) != 1) throw; return x; }
inline double nextDouble() { double x; if (scanf("%lf", &x) != 1) throw; return x; }

const int INF = (int)1E9;
const int64 INF64 = (int64)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;

const int MAXN = 200100;

int64 gcd(int64 a, int64 b) {
	if (min(a, b) == 0) return a + b;
	return gcd(b % a, a);
}

int64 a[MAXN];
int n;

int main() {
#ifdef NALP_PROJECT
	freopen("input.txt", "rt", stdin);
//	freopen("output.txt", "wt", stdout);
#else
#endif

	n = nextInt();
	forn(i, n)
		a[i] = nextInt();
	sort(a, a + n);

	int64 ans = 0;
	forn(i, n)
		ans += a[i] * (n - 1);

	forn(i, n - 1)
		ans += (a[i + 1] - a[i]) * (i + 1) * (n - i - 1) * 2 * (n - 1);

	int64 z = 1LL * n * (n - 1), g = gcd(ans, z);
	cout << ans/g << " " << z/g << endl;

	return 0;
}


#ifdef NALP_PROJECT
#pragma hdrstop
#else
#define _SECURE_SCL 0
#endif

#define _CRT_SECURE_NO_DEPRECATE
#pragma comment(linker, "/STACK:200000000")

#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <utility>
#include <cassert>

#include <set>
#include <map>
#include <vector>
#include <string>
#include <queue>
#include <bitset>
#include <memory.h>

#include <iostream>
#include <fstream>
#include <sstream>

using namespace std;

typedef long long int64;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define y1 YYY1
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

#ifdef _WIN32
	#define LLD "%I64d"
#else
	#define LLD "%lld"
#endif

template<typename T> inline T Abs(T x) { return (x >= 0) ? x : -x; }
template<typename T> inline T sqr(T x) { return x * x; }
template<typename T> inline string toStr(T x) { stringstream st; st << x; string s; st >> s; return s; }
template<typename T> inline int bit(T mask, int b) { return (b >= 0 && (mask & (T(1) << b)) != 0) ? 1 : 0; }

inline int nextInt() { int x; if (scanf("%d", &x) != 1) throw; return x; }
inline int64 nextInt64() { int64 x; if (scanf(LLD, &x) != 1) throw; return x; }
inline double nextDouble() { double x; if (scanf("%lf", &x) != 1) throw; return x; }

const int INF = (int)1E9;
const int64 INF64 = (int64)1E18;
const long double EPS = 1E-9;
const long double PI = 3.1415926535897932384626433832795;

const int MAXN = 200100;

int64 gcd(int64 a, int64 b) {
	if (min(a, b) == 0) return a + b;
	return gcd(b % a, a);
}

int64 a[MAXN];
int n;

int main() {
#ifdef NALP_PROJECT
	freopen("input.txt", "rt", stdin);
//	freopen("output.txt", "wt", stdout);
#else
#endif

	n = nextInt();
	forn(i, n)
		a[i] = nextInt();
	sort(a, a + n);

	int64 ans = 0;
	forn(i, n)
		ans += a[i] * (n - 1);

	forn(i, n - 1)
		ans += (a[i + 1] - a[i]) * (i + 1) * (n - i - 1) * 4;

	int64 z = 1LL * n * (n - 1), g = gcd(ans, z);
	cout << ans/g << " " << z/g << endl;

	return 0;
}


#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;

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

int main(){
    long long n;
    long long i;
    cin>>n;
    //scanf("%I64d",&n);
    for(i=0;i<n;i++) cin>>A[i];
    sort(A,A+n);
    long long g,s,num;
    s=num=0;
    for(i=0;i<n;i++){
        s+=A[i]*i-num;
        num+=A[i];
    }
    s=s*2;
    s+=num;
    g=gcd(s,n);
    //printf("%I64d %I64d\n",sum/g,n/g);
    cout<<s/g<<" "<<n/g<<endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

long long gcd(long long a, long long b) {
	if (a * b == 0)
		return a + b;
	return gcd(b, a % b);
}

int main() {
	long long n, m, a[110000];
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	sort(a, a + n);
	//n = 90000;
	//for (int i = 0; i < n; ++i) {
	//	a[i] = 10000000 + i;
	//}
	m = 0;
	for (int i = 1; i < n; ++i) {
		m += 2 * i * (n - i) * (a[i] - a[i-1]);
	}
	for (int i = 1; i <= n; ++i) {
		m += (n + 1 - i) * (a[i - 1] - (i == 1 ? 0 : a[i - 2]));
	}
	cout << m / gcd(m, n)<< " " << n / gcd(m, n);
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>

using namespace std;

long long gcd(long long a, long long b) {
	if (a * b == 0)
		return a + b;
	return gcd(b, a % b);
}

int main() {
	long long n, m, a[110000];
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	//n = 90000;
	//for (int i = 0; i < n; ++i) {
	//	a[i] = 10000000 + i;
	//}
	m = 0;
	for (int i = 1; i < n; ++i) {
		m += 2 * i * (n - i) * (a[i] - a[i-1]);
	}
	for (int i = 1; i <= n; ++i) {
		m += (n + 1 - i) * (a[i - 1] - (i == 1 ? 0 : a[i - 2]));
	}
	cout << m / gcd(m, n)<< " " << n / gcd(m, n);
	return 0;
}


#pragma comment(linker, "/STACK:32777216")
#include <iostream>
#include <vector>
#include <set>
#include <cstdio>
#include <cmath>
#include <string>
#include <sstream>
#include <algorithm>
#include <map>
#include <queue>
#include <memory.h>

using namespace std;

#define next fdfdsfdsfdsfdsfds
#define y1 ggvfdg
#define FOR(i,a,b) for(int (i)=(a);(i)<(b);++(i))
#define RFOR(i,a,b) for(int (i)=(a)-1;(i)>=(b);--(i))
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define PB push_back
#define PII pair<int,int>
#define FILL(a,b) memset((a),b,sizeof((a)))
#define X first
#define Y second
#define sz(a) (int)(a).size()
#define SZ(a) (int)(a).size()
#define y1 asdf

typedef long long Int;
typedef unsigned long long UInt;
typedef vector<int> VI;

const long double pi=acos(-1.0);
const int INF=1000000000;
const int MOD = 1000000007;
const double EPS = 1e-7;

Int gcd(Int a,Int b){
    if (!b) return a;
    return gcd(b , a % b);
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("in.txt" , "r" , stdin);
#endif

    int n;
    cin >> n;
    Int r = 0;
    vector<int> a(n);
    FOR(i,0,n){
        cin >> a[i];
        r += abs(a[i]);
    }

    sort(ALL(a));

    Int s = 0;
    FOR(i,1,a.size()){
        s += 1LL * i * (a[i] - a[i - 1]);
        r += 2 * s;
    }

    Int p = n;

    Int g = gcd(r,p);
    cout << r / g << ' ' << p / g << endl;

    return 0;
}


#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <deque>
using namespace std;

long long int gcd(long long int a, long long int b)
{
    while (b)
    {
        a%=b;
        swap(a,b);
    }
    return a;
}

int main()
{
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
    int i,n;
    long long int top=0,help;
    cin>>n;
    vector <int> v(n);
    for (i=0; i<n; i++) cin>>v[i];
    sort(v.begin(), v.end());
    for (i=0; i<n; i++)
        top+=1ll*(2*n-4*i-1)*v[n-i-1];
    help=gcd(top,1ll*n);
    cout<<top/help<<" "<<1ll*n/help<<endl;
    return 0;
}


#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <queue>
#include <memory.h>
#include <stack>

using namespace std;

#define pb push_back
#define mp make_pair
#define fir first
#define fi first
#define sec second
#define y1 botva23
typedef long long int64;
typedef long double ld;

const int inf = 2000000000;
const ld eps = 1e-07;

int64 gcd(int64 x, int64 y) {
    if (x % y == 0)
        return y;
    else return gcd(y, x % y);
}

int64 n;
int64 a[101000];
int64 suf[101000];

int main() {
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    sort(a, a + n);
    int64 sum = 0;
    for (int i = 0; i < n; ++i)
        sum += a[i];
    for (int i = n - 1; i >= 0; --i) {
        suf[i] = suf[i + 1] + a[i];
    }
    int64 sum2 = 0;
    for (int i = 0; i < n; ++i) {
        sum2 += suf[i + 1] - (n - i - 1) * a[i];
    }
    int64 ans1 = sum + 2 * sum2;
    int64 ans2 = n;
    int64 g = gcd(ans1, ans2);
    cout << ans1 / g << " " << ans2 / g << endl;
    return 0;
}


#pragma comment(linker, "/stack:20000000")

# include <iostream>
# include <cmath>
# include <algorithm>
# include <cstdio>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <deque>
# include <functional>
# include <sstream>
# include <fstream>
using namespace std;

#define DEBUG

#define DB(x) cout<<#x<<"="<<x<<" "
#define DBN(x) cout<<#x<<"="<<x<<"\n"

#ifdef DEBUG
#define D(x) DEBN(x)
#define DN(x) DEBN(x)
#define DA(a,n) cout<<#a<<"=["; printarray(a,n); cout<<"]\n"
#define DAR(a,n,s) cout<<#a<<"["<<s<<"-"<<n-1<<"]=["; printarray(a,n,s); cout<<"]\n"
#else
#define D(x)
#define DN(x)
#define DA(a,n)
#define DAR(a,n,s)
#endif

#define mp make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
typedef vector<int> vi;
typedef vector<long long> vll;

template<typename T1,typename T2,typename T3>
struct triple{T1 a;T2 b;T3 c;triple(){};triple(T1 _a,T2 _b, T3 _c):a(_a),b(_b),c(_c){}};
#define tri triple<int,int,int>
#define trl triple<ll,ll,ll>
template<typename T1,typename T2,typename T3>
bool operator<(const triple<T1,T2,T3> &t1,const triple<T1,T2,T3> &t2){ if (t1.a!=t2.a) return t1.a<t2.a; else if (t1.b!=t2.b) return t1.b<t2.b; else return t1.c<t2.c;}
template<typename T1,typename T2,typename T3>
ostream& operator<<(std::ostream & os,const triple<T1,T2,T3> &tr) {os<<"{"<<tr.a<<","<<tr.b<<","<<tr.c<<"}"; return os;}

#define FI(n) for(int i=0;i<n;i++)
#define FI1(n) for(int i=1;i<n;i++)
#define FJ(n) for(int j=0;j<n;j++)
#define FJ1(n) for(int j=1;j<n;j++)
#define FJI for(int j=0;j<i;j++)
#define FJI1 for(int j=1;j<i;j++)
#define FJIE for(int j=0;j<=i;j++)
#define FJIE1 for(int j=1;j<=i;j++)
#define For(i,a,b) for(int i=a;i<b;i++)

// Input macros
#define S(n)                        scanf("%d",&n)
#define Sc(n)                       scanf("%c",&n)
#define Sl(n)                       scanf("%I64d",&n)
#define Sf(n)                       scanf("%lf",&n)
#define Ss(n)                       scanf("%s",n)

//Output macros
#define Pr(n)                        printf("%d ",n)
#define Prn(n)                        printf("%d\n",n)
#define Prc(n)                      printf("%c",n)
#define Prcn(n)                     printf("%c\n",n)
#define Prl(n)                      printf("%I64d ",n)
#define Prln(n)                     printf("%I64d\n",n)
#define Prf(n)                      printf("%lf ",n)
#define Prfn(n)                     printf("%lf\n",n)
#define Prs(n)                      printf("%s ",n)
#define Prsn(n)                     printf("%s\n",n)

//STL containers
#define foreach(v, c)               for( auto v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ((b).find(a) != (b).end())
#define in2(a,b)                    (find(all(b),a) != (b).end())
#define pb                          push_back
#define sz(a)                       ((int)(a.size()))
#define svi(vec,n) FI(n) S(vec[y])
#define svl(vec,n) FI(n) Sl(vec[y])
#define IT ::iterator

//fill char arrays
#define fill(a,v)                    memset(a, v, sizeof (a))

#define checkbit(n,b)                ( (n >> b) & 1)
#define INDEX(arr,ind)               (lower_bound(all(arr),ind)-arr.begin())
#define sor(a)  sort(all(a))
#define rsor(a) sort(all(a)); reverse(all(a));

//STL output ********************************
template<typename T1,typename T2>inline std::ostream& operator << (std::ostream& os, const std::pair<T1, T2>& p){return os << "(" << p.first << ", " << p.second << ")";}
template<typename T>inline std::ostream &operator<<(std::ostream &os,const std::vector<T>& v){bool first=true;os<<"[";for(unsigned int i=0;i<v.size();i++){if(!first)os<<", ";os<<v[i];first=false;}return os<<"]";}
template<typename T>inline std::ostream &operator<<(std::ostream &os,const std::set<T>&v){bool first=true;os << "[";for(typename std::set<T>::const_iterator ii=v.begin();ii!=v.end();++ii){if(!first)os<<", ";os<<*ii;first=false;}return os<<"]";}
template<typename T1, typename T2>inline std::ostream &operator << (std::ostream & os,const std::map<T1, T2>& v){bool first = true; os << "[";for (typename std::map<T1,T2>::const_iterator ii =v.begin();ii!=v.end();++ii){if(!first)os<<", ";os<<*ii;first=false;}return os<<"]";}
template<typename T,typename T2>void printarray(T  a[],T2 sz,T2 beg=0){for(T2 i=beg;i<sz;i++) cout<<a[i]<<" ";cout<<endl;}

#define sqr(x) ((x)*(x))
#define sqrt(x) sqrt(1.0*(x))
#define pow(x,n) pow(1.0*(x),n)

inline ll binpow(ll x,ll n){ll res=1;while(n){if(n&1)res*=x;x*=x;n>>=1;}return res;}
inline ll mulmod(ll x,ll n, ll _mod){ll res=0;while(n){if(n&1)res=(res+x)%_mod;x=(x<<1)%_mod;n>>=1;}return res;}
inline ll powmod(ll x,ll n, ll _mod){ll res=1;while(n){if(n&1)res=(res*x)%_mod;x=(x*x)%_mod;n>>=1;}return res;}
inline ll gcd(ll a,ll b){ll t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
inline int gcd(int a,int b){int t;while(b){a=a%b;t=a;a=b;b=t;}return a;}
inline ll lcm(int a,int b){return a/gcd(a,b)*(ll)b;}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll gcd(ll a,ll b,ll c){return gcd(gcd(a,b),c);}
inline int gcd(int a,int b,int c){return gcd(gcd(a,b),c);}
inline ll lcm(ll a,ll b,ll c){return lcm(lcm(a,b),c);}
inline ll lcm(int a,int b,int c){return lcm(lcm(a,b),(ll)c);}

inline ll max(ll a,ll b){return (a>b)?a:b;}
inline int max(int a,int b){return (a>b)?a:b;}
inline double max(double a,double b){return (a>b)?a:b;}
inline ll max(ll a,ll b,ll c){return max(a,max(b,c));}
inline int max(int a,int b,int c){return max(a,max(b,c));}
inline double max(double a,double b,double c){return max(a,max(b,c));}
inline ll min(ll a,ll b){return (a<b)?a:b;}
inline int min(int a,int b){return (a<b)?a:b;}
inline double min(double a,double b){return (a<b)?a:b;}
inline ll min(ll a,ll b,ll c){return min(a,min(b,c));}
inline int min(int a,int b,int c){return min(a,min(b,c));}
inline double min(double a,double b,double c){return min(a,min(b,c));}
inline int fastMax(int x, int y) { return (((y-x)>>(32-1))&(x^y))^y; }
inline int fastMin(int x, int y) { return (((y-x)>>(32-1))&(x^y))^x; }

inline void getar(int *a,int n){for (int ii=0;ii<n;ii++){scanf("%d",a+ii);}}
inline void getar(ll *a,int n){for (int ii=0;ii<n;ii++){scanf("%I64",a+ii);}}

// Useful constants

#define INF           1000000000
#define EPS            (double)1e-7
#define mod 1000000
#define PI 3.14159265358979328462
/******************************************************************************/

int a[100010];
int main()
{
    int n;
    S(n);
    getar(a,n);
    sort(a,a+n);
    ll s = 0;
    for (int i=0;i<n;i++)
    {
        s += a[i];
    }
    ll pref = 0;
    for (int i=0;i<n;i++)
    {
        s += 2 * (a[i]*1ll*i - pref);
        pref += a[i];
    }
    ll t = gcd(s,1ll*n);
    s/=t;
    n/=t;
    cout<<s<<" "<<n<<endl;
    return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
bool used[1111];
long long n,a[1111],b[1111],sum;
long long nod(long long x, long long y)
{
	while(x&&y)
		if (x>y)
			x%=y;
		else y%=x;
	return x+y;
}
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>b[i];
	sort(b,b+n);
	for(int i=n-1;i>0;i--)
		b[i]-=b[i-1];
	//n=3;
	/*rec(0);
	for(int i=0;i<n;i++)
		cout<<k[i]<<" ";*/
	for(int i=1;i<=n;i++)
	{
		a[i-1]=(2*i-1)*(n+1-i);
		sum+=a[i-1]*b[i-1];
	}
	cout<<sum/nod(sum,n)<<" "<<n/nod(n,sum)<<endl;
	return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
bool used[1111];
long long n,a[1111],b[1111],sum;
long long nod(long long x, long long y)
{
	while(x&&y)
		if (x>y)
			x%=y;
		else y%=x;
	return x+y;
}
/*void rec(int x)
{
	if (x<n)
	{
		for(int i=0;i<n;i++)
			if (!used[i])
			{
				used[i]=true;
				a[x]=i;
				rec(x+1);
				used[i]=false;
			}
	}
	else
	{
		int f=0;
		k[0]++;
		for(int i=0;i<n;i++)
		{
			for(int j=f+1;j<=a[i];j++)
				k[j]++;
			for(int j=a[i];j<f;j++)
				k[j]++;
			f=a[i];
		}
	}
}*/
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>b[i];
	for(int i=n-1;i>0;i--)
		b[i]-=b[i-1];
	//n=3;
	/*rec(0);
	for(int i=0;i<n;i++)
		cout<<k[i]<<" ";*/
	for(int i=1;i<=n;i++)
	{
		a[i-1]=(2*i-1)*(n+1-i);
		sum+=a[i-1]*b[i-1];
	}
	cout<<sum/nod(sum,n)<<" "<<n/nod(n,sum)<<endl;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
bool used[111111];
long long n,a[111111],b[111111],sum;
long long nod(long long x, long long y)
{
	while(x&&y)
		if (x>y)
			x%=y;
		else y%=x;
	return x+y;
}
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>b[i];
	sort(b,b+n);
	for(int i=n-1;i>0;i--)
		b[i]-=b[i-1];
	//n=3;
	/*rec(0);
	for(int i=0;i<n;i++)
		cout<<k[i]<<" ";*/
	for(int i=1;i<=n;i++)
	{
		a[i-1]=(2*i-1)*(n+1-i);
		sum+=a[i-1]*b[i-1];
	}
	cout<<sum/nod(sum,n)<<" "<<n/nod(n,sum)<<endl;
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <string.h>
#include <math.h>
using namespace std;
#define LL long long
#define MXN 100010
int n,num[MXN];
LL total;
void Init()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&num[i]);
}
LL gcd (LL a,LL b)
{
	return b==0?a:gcd(b,a%b);
}
void solve()
{
	sort(num+1,num+n+1);
	for(int i=1,j=1;i<=n;i++,j+=2) total+=(LL)(j-n)*(LL)(num[i]);
	total*=2;
	for(int i=1;i<=n;i++) total+=(LL)num[i];
	LL nn=(LL)n;
	LL d=gcd(total,nn);
	printf("%I64d %I64d\n",total/d,nn/d);
}
int main()
{
	Init();
	solve();
    return 0;
}


#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;

const int NMAX=100000;

ll gcd(ll a,ll b)
{
	if(b!=0)while((a%=b)!=0&&(b%=a)!=0);
	return a+b;
}

int main()
{
	static int A[1+NMAX];
	static ll  S[1+NMAX];
	int N;
	scanf("%d",&N);
	for(int i=1;i<=N;i++)scanf("%d",A+i);
	sort(A+1,A+1+N);
	for(int i=1;i<=N;i++)S[i]=S[i-1]+A[i];
	ll P=0,Q=N,R;
	for(int i=1;i<=N;i++)
	{
		P+=A[i];
		P+=2*((S[N]-S[i])-(ll)(N-i)*A[i]);
	}
	R=gcd(P,Q);
	printf("%I64d %I64d\n",P/R,Q/R);
	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <iostream>
#include <string>

using namespace std;

long long gcd(long long a, long long b)
{
    while(a > 0)
    {
        b %= a;
        swap(a, b);
    }
    return b;
}

int n;
int a[100005];

int main()
{
    scanf("%d", &n);
    for(int i = 0; i < n; i++)
        scanf("%d", &a[i]);

    a[n++] = 0;
    sort(a, a + n);

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

    long long g = gcd(sum, n - 1);
    cout << sum / g << " " << (n - 1) / g << endl;

    return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<math.h>
#include<cmath>
#include<iomanip>
#include<ctime>

using namespace std;

#define fr first
#define sc second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define forn(i, n) for (int i = 0; i < (int)(n); i++)
#define sqr(x) (x) * (x)
#define ford(i, n) for (int i = n - 2; i >= 0; i--)

typedef long long ll;

const int INF = (int)1e9 + 7;
const double eps = 1e-8;
const ll INF_64 = (ll)1e18;

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
		return gcd(b, a % b);
}

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

	int n;
	cin >> n;
	vector<ll> a(n);
	forn(i, n)
		cin >> a[i];
	sort(all(a));
	ll c = 0, d;
	d = n;
	vector<ll> s(n);
	forn(i, n)
	{
		s[i] = a[i];
		if (i > 0)
			s[i] += s[i - 1];
	}
	forn(i, n)
	{
		if (i > 0)
			c += i * a[i] - s[i - 1];
		if (i < n - 1)
			c += (s[n - 1] - s[i]) - (n - i - 1) * a[i];
	}
	forn(i, n)
		c += a[i];
	ll g = gcd(c, d);
	c /= g;
	d /= g;
	cout << c << " " << d;
}


#include <cstdio>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string>
#include <vector>
#include <set>
#include <map>
using namespace std;
//#define FILENAME "1dembedding"
#define mp make_pair
#define all(a) a.begin(), a.end()
typedef long long li;
void solve();
int main() {
#ifdef room210
    freopen("in.txt", "r", stdin);
#else
    //freopen(FILENAME".in", "r", stdin);
    //freopen(FILENAME ".out", "w", stdout);
#endif
    int t = 1;
	//cin >> t;
    while (t--)
        solve();
    return 0;
}

//BE CAREFUL: IS INT REALLY INT?

#define int li

int n;
int a[100500];

int gcd (int q, int w) {
	while (w) {
		q %= w;
		swap(q, w);
	}
	return q;
}

void solve() {
	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	int sum = 0;
	for (int i = 1; i < n; ++i) {
		sum += (n - i) * (2 * i + 1) * (a[i + 1] - a[i]);
	}
	sum += a[1] * n;
	int g = gcd(sum, n);
	cout << sum / g << ' ' << n / g << endl;
}


#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;

typedef __int64 ll;

vector<ll> numbers;
ll N;

ll gcd(ll x, ll y){
	if(x < y)
		return gcd(y, x);
	if(y == 0) return x;
	return gcd(y, x % y);
}

int main(){
	scanf("%I64d", &N);
	int i;
	for(i = 0; i < N; i++){
		ll n;
		scanf("%I64d", &n);
		numbers.push_back(n);
	}
	sort(numbers.begin(), numbers.end());

	ll S = numbers[0];
	ll realS = 0;
	for(i = 1; i < N; i++){
		realS += i * numbers[i] - S;
		S += numbers[i];
	}
	ll finalS = realS * 2 + S;

	ll gcdval = gcd(finalS, N);
	printf("%I64d %I64d", finalS / gcdval, N / gcdval);

	return 0;
}


#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>       //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>      //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;

LL nwd(LL a, LL b) { return b ? nwd(b, a%b) : a; }

#define MR 100010

int p[MR];
LL dp[MR];

int main()
{
    int n;
    scanf("%d", &n);
    REP(i,n) scanf("%d", &p[i]);
    sort(p,p+n);
    LL res = 0;
    REP(i,n) res += p[i];
    FOR(i,1,n) dp[i] = dp[i-1] + i*(LL)(p[i]-p[i-1]);
    FOR(i,1,n) dp[i] += dp[i-1];
    res += 2*dp[n-1];
    LL d = nwd(res, n);
    printf("%lld %lld\n", res/d, n/d);
    return 0;
}


//#pragma comment(linker, "/STACK:1000 000 00")

#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <iostream>

#include <hash_map>
#include <map>
#include <hash_set>
#include <set>

#include <functional>
#include <string>

using namespace std;

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

long long v[100000 + 10];

int main() {

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

	long long n;

	cin >> n;
	for (int i = 0; i < n; ++i) scanf("%I64d", &v[i]);
	sort(v, v + n);

	long long num = 0, den = n, cur;

	cur = v[0];
	num = n * cur;

	for (long long i = 1; i < n; ++i) {
		long long t = v[i];
		num += (t - cur) * (n - i) * (i + i + 1);
		cur = t;
	}

	long long g = gcd(num, den);
	cout << num / g << " " << den / g;

	return 0;
}


//#pragma comment(linker, "/STACK:1000 000 00")

#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <iostream>

#include <hash_map>
#include <map>
#include <hash_set>
#include <set>

#include <functional>
#include <string>

using namespace std;

int n;

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

int main() {

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

	cin >> n;
	long long num = 0, den = n, cur;

	cin >> cur;
	num = n * cur;

	for (int i = 1; i < n; ++i) {
		long long t;
		scanf("%I64d", &t);
		num += (t - cur) * (n - i) * (i + i + 1);
		cur = t;
	}

	long long g = gcd(num, den);
	cout << num / g << " " << den / g;

	return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

#define LL long long
LL a[100001];
LL gcd (LL a , LL b){
    if(!b)
        return a;
    return gcd(b, a % b);
}
int main(){

    int n;
    LL ans = 0;
    cin >> n;
    LL k = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        k += a[i];
    }
    sort(a, a + n);
    for(int i = 0; i < n -1; i++){
        ans += (a[i + 1] - a[i]) * ( (LL) (n - i - 1) * (LL)(i + 1));
    }
    ans *= 2ll;
    ans += k;
    LL x = gcd(ans, n);
    cout << ans / x << " " << n / x << endl;
    return 0;
}


#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;

#define LL long long
LL a[100001];
LL gcd (LL a , LL b){
    if(!b)
        return a;
    return gcd(b, a % b);
}
int main(){

    int n;
    LL ans = 0;
    cin >> n;
    LL k = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        k += a[i];
    }
    for(int i = 0; i < n -1; i++){
        ans += (a[i + 1] - a[i]) * ( (LL) (n - i - 1) * (LL)(i + 1));
    }
    ans *= 2ll;
    ans += k;
    LL x = gcd(ans, n);
    cout << ans / x << " " << n / x << endl;
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <set>

using namespace std;

#define FOR(i,a,b) for(i = a; i < b; ++i)
#define pb push_back
#define mp make_pair
#define INF 1000000000

long long gcd(long long a, long long b) {
    while (a && b) {
      if (a>b) a%=b; else b%=a;
    }
    return (a+b);
}

int a[333333];
long long s[333333];
int i,j,n;
long long ans = 0;

int main(){
  scanf("%d",&n);
  for (int i = 0; i < n; ++i) {
    scanf("%d",&a[i]);
  }
  sort(a,a+n);
  s[0] = a[0];
  for (int i = 1; i < n; ++i) s[i] = s[i-1] + a[i];
  for (int i = 1; i < n; ++i)
      ans += ((long long) a[i] * (long long) i - s[i-1]);
  ans = ans * 2;
  for (int i = 0; i < n; ++i)
       ans += a[i];
  long long d = gcd(ans, n);
  cout << ans/d << " " << n/d << endl;
  return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#pragma comment (linker, "/STACK:1000000000")

#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <set>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <complex>
#include <hash_map>
#include <hash_set>

using namespace std;

#define pb push_back
#define pob pop_back
#define rs resize
#define as assign
#define lwb lower_bound
#define upb upper_bound
#define mp make_pair
#define sz(a) a.size()
#define FOR(i, n) for (int i = 0; i < n; ++i)
#define FOD(i, n) for (int i = n - 1; i >= 0; --i)

typedef long long ll;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef vector <bool> vb;
typedef vector <vb> vvb;
typedef vector <string> vs;
typedef vector <vs> vvs;
typedef vector <char> vc;
typedef vector <vc> vvc;
typedef vector <vvi> vvvi;
typedef vector <vvvi> vvvvi;
typedef vector <vvl> vvvl;
typedef vector <vvvl> vvvvl;
typedef vector <vvb> vvvb;
typedef double db;
typedef long double ldb;
typedef vector <db> vdb;
typedef vector <vdb> vvdb;
typedef vector <vvdb> vvvdb;
typedef vector <ldb> vldb;
typedef pair <int, int> ii;
typedef pair <int, char> ic;
typedef pair <ll, ll> lll;
typedef pair <int, ll> il;
typedef pair <ll, int> li;
typedef vector <ii> vii;
typedef vector <ic> vic;
typedef vector <vic> vvic;
typedef vector <vii> vvii;
typedef vector <lll> vll;
typedef vector <vll> vvll;
typedef set <int> si;
typedef set <ii> sii;
typedef set <pair <int, bool> > sib;
typedef vector <si> vsi;
typedef vector <sii> vsii;
typedef map <int, int> mii;
typedef map <string, char> msc;
typedef map <char, int> mci;
typedef queue <int> qi;
typedef deque <int> di;
typedef stack <int> sti;

const int inf = 1000000007;
const ldb eps = 1e-18;
const ll pr = 31;
const int sf = 450000;

ll gcd(ll a, ll b)
{
    if (b > a)
        swap(a, b);
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main()
{
    ll n;
    scanf("%I64d", &n);
    vl a(n);
    ll s = 0;
    for (int i = 0; i < n; ++i)
        scanf("%I64d", &a[i]);
    sort(a.begin(), a.end());
    ll d = 0;
    for (ll i = n - 1; i >= 0; --i)
    {
        s += (i - d) * a[i];
        ++d;
    }
    s *= 2;
    for (ll i = 0; i < n; ++i)
        s += a[i];
    ll q = gcd(s, n);
    printf("%I64d %I64d", s / q, n / q);
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#pragma comment (linker, "/STACK:1000000000")

#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <set>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <complex>
#include <hash_map>
#include <hash_set>

using namespace std;

#define pb push_back
#define pob pop_back
#define rs resize
#define as assign
#define lwb lower_bound
#define upb upper_bound
#define mp make_pair
#define sz(a) a.size()
#define FOR(i, n) for (int i = 0; i < n; ++i)
#define FOD(i, n) for (int i = n - 1; i >= 0; --i)

typedef long long ll;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <ll> vl;
typedef vector <vl> vvl;
typedef vector <bool> vb;
typedef vector <vb> vvb;
typedef vector <string> vs;
typedef vector <vs> vvs;
typedef vector <char> vc;
typedef vector <vc> vvc;
typedef vector <vvi> vvvi;
typedef vector <vvvi> vvvvi;
typedef vector <vvl> vvvl;
typedef vector <vvvl> vvvvl;
typedef vector <vvb> vvvb;
typedef double db;
typedef long double ldb;
typedef vector <db> vdb;
typedef vector <vdb> vvdb;
typedef vector <vvdb> vvvdb;
typedef vector <ldb> vldb;
typedef pair <int, int> ii;
typedef pair <int, char> ic;
typedef pair <ll, ll> lll;
typedef pair <int, ll> il;
typedef pair <ll, int> li;
typedef vector <ii> vii;
typedef vector <ic> vic;
typedef vector <vic> vvic;
typedef vector <vii> vvii;
typedef vector <lll> vll;
typedef vector <vll> vvll;
typedef set <int> si;
typedef set <ii> sii;
typedef set <pair <int, bool> > sib;
typedef vector <si> vsi;
typedef vector <sii> vsii;
typedef map <int, int> mii;
typedef map <string, char> msc;
typedef map <char, int> mci;
typedef queue <int> qi;
typedef deque <int> di;
typedef stack <int> sti;

const int inf = 1000000007;
const ldb eps = 1e-18;
const ll pr = 31;
const int sf = 450000;

ll gcd(ll a, ll b)
{
    if (b > a)
        swap(a, b);
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main()
{
    ll n;
    scanf("%I64d", &n);
    vl a(n);
    ll s = 0;
    for (int i = 0; i < n; ++i)
        scanf("%I64d", &a[i]);
    sort(a.begin(), a.end());
    ll d = 0;
    for (ll i = n - 1; i >= 0; --i)
    {
        s += (i - d) * a[i];
        ++d;
    }
    s *= 2;
    for (ll i = 0; i < n; ++i)
        s += a[i];
    s *= 4;
    ll q = gcd(s, n * (n + 1));
    printf("%I64d %I64d", s / q, n * (n + 1) / q);
    return 0;
}


#include <cstdio>
#include <vector>
#include <algorithm>
#include <memory.h>
#include <cmath>
#include <string>

using namespace std;

__int64 a[100005];
__int64 sum = 0;
__int64 sum2 = 0;

__int64 GCD(__int64 a, __int64 b)
{
    return a ? GCD(b % a, a) : b;
}

int main(void)
{
    int n;
    scanf("%d",&n);
    for (int i = 0; i < n; i++)
    {
        scanf("%I64d",&a[i]);
        sum += a[i];
    }
    sort(a,a+n);
    for (int i = 0; i < n - 1; i++)
    {
        __int64 diff = a[i+1] - a[i];
        sum2 += diff * (i + 1) * (n - (i+1));
    }
    sum += sum2 * 2;
    __int64 g = GCD(sum, n);
    sum /= g;
    n /= g;
    printf("%I64d %I64d\n", sum,n);
}


#include <iostream>
#include <algorithm>

using namespace std;

long long a[100002];

int main ()
{
    long long n;
    cin >> n;
    long long sum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        sum += a[i];
    }
    sort(a,a + n);
    long long ans = sum;
    reverse (a,a + n);
    for (int i = 0; i < n; i++)
    {
        sum -= a[i];
        ans += 2 * ((n - i - 1) * a[i] - sum);
    }
    int bmm = 1;
    for (int i = 2; i <= min(n,ans); i++)
        if (n % i == 0 && ans % i == 0)
            bmm = i;
    cout << ans / bmm << " " << n / bmm << endl;
    return 0;
}


//#define ONLINE_JUDGE

#if defined(ONLINE_JUDGE)
#define _SECURE_SCL 0
#endif

#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <climits>
#include <numeric>
#include <memory.h>

#if !defined(__GNUC__)
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed long int32_t;
typedef unsigned long uint32_t;
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#else // !defined(__GNUC__)
#define _CrtDbgBreak()
#endif // !defined(__GNUC__)

#if defined(ONLINE_JUDGE)
#define LOCAL_TEST 0
#else
#define LOCAL_TEST 1
#endif

#if LOCAL_TEST
#define LOCAL_ASSERT(expr) { if (!(expr)) {std::cout << "ASSERT FAILED: '" << #expr << "'" << std::endl; _CrtDbgBreak(); } }
#else
#define LOCAL_ASSERT(expr)
#endif

typedef long double double_t;
typedef std::string string8_t;

typedef std::vector<size_t> vector_size_t;
typedef std::vector<uint64_t> vector_uint64_t;
typedef std::vector<int32_t> vector_int32_t;
typedef std::vector<vector_size_t> vector_2d_size_t;
typedef std::vector<string8_t> vector_string8_t;
typedef std::set<size_t> set_size_t;
typedef std::multiset<string8_t> multiset_string8_t;

// Auxiliary functions definition
//
template<typename T> inline T Abs(const T a) { return a < 0 ? -a : a; }
template<typename T> inline T Min(const T a, const T b) {return a < b ? a : b;}
template<typename T> inline T Max(const T a, const T b) {return a > b ? a : b;}
template<typename T> inline void UpdateMin(T& a, const T b) {a = Min(a, b);}
template<typename T> inline void UpdateMax(T& a, const T b) {a = Max(a, b);}

static const double_t eps = 1.0e-09;
template<typename T> inline bool IsEqual(const T a, const T b) { return Abs(a - b) < eps; }
template<typename T> inline bool IsGreater(const T a, const T b) { return a > b + eps; }
template<typename T> inline bool IsLess(const T a, const T b) { return a + eps < b; }

template<typename T> inline string8_t ToStr(const T& val) { std::ostringstream ostr; ostr << val; return ostr.str(); }
template<typename T> inline bool FromStr(const string8_t& str, T& val) {std::istringstream istr(str); istr >> val; return !!istr; }

#if defined(ONLINE_JUDGE)
template<size_t id> class StopWatch { };
#elif !defined(__GNUC__)
#include <library/lib_stopwatch.h>
#else
#include "../../library/library/lib_stopwatch.h"
#endif

uint64_t Gcd(const uint64_t x, const uint64_t y)
{
    uint64_t a = x;
    uint64_t b = y;

    if (a < b)
        std::swap(a, b);

    while (a != 0)
    {
        if (a < b)
            std::swap(a, b);
        a = a % b;
    }

    return b;
}

bool Solve(std::istream& ist, std::ostream& ost, const bool multipleTestMode)
{
    StopWatch<1> sw; sw;

    //
    size_t n;
    ist >> n;

    if (multipleTestMode && !ist)
        return false;

    //
    vector_uint64_t a(n);
    for (size_t i = 0; i < n; i++)
    {
        ist >> a[i];
    }

    std::sort(a.begin(), a.end());

    uint64_t s = 0;
    for (size_t i = 0; i + 1 < n; i++)
    {
        const uint64_t di = a[i + 1] - a[i];
        s += di * (n - i - 1) * (i + 1);
    }
    s *= 2;

    s = std::accumulate(a.begin(), a.end(), s);

    const uint64_t g = Gcd(s, n);
    ost << (s / g) << ' ' << (n / g) << std::endl;

    return multipleTestMode;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::istream& ist = std::cin;
    std::ostream& ost = std::cout;
#if defined(ONLINE_JUDGE)
    Solve(ist, ost, false);
#else
    while(Solve(ist, ost, true)) {};
#endif
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <complex>
using namespace std;
#define pb push_back
#define mp make_pair
#define point complex<double>
#define xx real()
#define yy imag()

const int MAXN = 100005;

long long a[MAXN], d[MAXN], s[MAXN], sd[MAXN];

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

void solve(){
    int i, j, n;
    scanf("%d", &n);
    for(i = 0; i < n; i++){
        scanf("%I64d", &a[i]);
    }
    sort(a, a + n);
    s[0] = a[0];
    d[0] = 0;
    sd[0] = 0;
    for(i = 1; i < n; i++){
        s[i] = s[i - 1] + a[i];
        d[i] = (a[i] - a[i - 1]) * i + d[i - 1];
        sd[i] = sd[i - 1] + d[i];
    }
    long long c = s[n - 1] + 2 * sd[n - 1];
    long long dd = (long long)(n);
    long long g = gcd(c, dd);
    c /= g;
    dd /= g;
    printf("%I64d %I64d", c, dd);
}

int main(){
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    int t;
    t = 1;
    while(t){
        t--;
        solve();
    }
}


#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <ctime>
#include <string>
#include <map>
#include <ctime>
#include <algorithm>

#pragma comment(linker,"/STACK:100000000")

using namespace std;

int n;
long long a[200000], sum;

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

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("outputt.txt","w",stdout);
    scanf("%d",&n);
    for (int i = 1 ; i <= n ; i ++ ) {
        scanf("%I64d",&a[i]);
        sum += a[i];
    };

    sort(a + 1, a + n + 1);
    long long sum2 = sum;
    for (int i = 1 ; i < n ; i ++ ) {
        sum -= a[i];
        sum2 += 2 * (sum - (n - i) * a[i]);
    };

    long long d = gcd(sum2, n);
    sum2 /= d;
    n /= d;

    printf("%I64d %I64d\n",sum2,n);

    return 0;
};


#include <iostream>
#include <algorithm>
using namespace std;

typedef long long int64;

const int N = 100500;

int n, a[N];

int64 gcd(int64 x, int64 y)
{
    return x ? gcd(y % x, x) : y;
}

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

    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);

    sort(a, a + n);

    int64 sum_a = 0;
    for (int i = 0; i < n; i++)
        sum_a += a[i];

    int64 sum_ab = 0;
    int64 pref_sum = 0;
    for (int i = 1; i < n; i++)
    {
        int64 d = a[i] - a[i - 1];
        pref_sum += d * i;
        sum_ab += pref_sum;
    }

    int64 nom = sum_a + 2 * sum_ab;
    int64 denom = n;
    int64 g = gcd(nom, denom);
    nom /= g;
    denom /= g;

    printf("%I64d %I64d", nom, denom);

    return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int MAXN=100000;
long long A[MAXN+1], S[MAXN+1];

long long gcd(long long a, long long b)
{
    while(1)
    {
        if(!b)
            return a;
        a%=b;
        if(!a)
            return b;
        b%=a;
    }
}

int main()
{
    int n, i;
    long long num, denom, g;

    scanf("%d", &n);
    for(i=1; i<=n; ++i)
        scanf("%I64d", A+i);

    sort(A+1, A+1+n);
    S[0]=0;
    for(i=1; i<=n; ++i)
        S[i]=S[i-1]+A[i];
    num=0;
    for(i=2; i<=n; ++i)
        num += (i-1)*A[i] - S[i-1];
    num<<=1;
    num+=S[n];
    g=gcd(num, n);
    num/=g;
    denom=n/g;

    printf("%I64d %I64d\n", num, denom);
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <map>
#include <list>
#include <algorithm>
#include <stack>
#include <functional>
#include <fstream>
#include <deque>
#include <queue>
#include <iostream>
#include <fstream>
#include <ctime>
#include <sstream>
#include <climits>

#define N 100003
#define PI 3.1415926535
#define EPS 0.00000001
#define MAX 1e9
#define MIN -(1e9)
#define ll long long
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fori(i,n) for(int (i) = 0; (i) < n; ++(i))
#define forin(i, n) for(int (i) = n-1; i >= 0; --(i))
#define mp(a, b) make_pair(a, b)
#define MOD 1000000007

using namespace std;

ll a[1234567];

int main()
{
    ios_base::sync_with_stdio(0);
    //fpeopen("input.txt", "r", stdin);
    //fpeopen("output.txt", "r", stdout);
    long long  n;
    cin >> n;
    ll sum = 0;
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    sort(a, a + n);
    long long verh = sum;
    long long niz = n;
    int counter = 1-n;
    for(int i = 0; i < n; ++i)
    {
        verh += 2*a[i] * counter;
        counter += 2;
    }
    for(int i = 2; i <= niz; ++i)
    {
        if(niz % i == 0 && verh % i == 0)
        {    niz /= i; verh /= i; }
    }
    cout << verh << " " << niz;
    //system("pause");
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <map>
#include <list>
#include <algorithm>
#include <stack>
#include <functional>
#include <fstream>
#include <deque>
#include <queue>
#include <iostream>
#include <fstream>
#include <ctime>
#include <sstream>
#include <climits>

#define N 100003
#define PI 3.1415926535
#define EPS 0.00000001
#define MAX 1e9
#define MIN -(1e9)
#define ll long long
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fori(i,n) for(int (i) = 0; (i) < n; ++(i))
#define forin(i, n) for(int (i) = n-1; i >= 0; --(i))
#define mp(a, b) make_pair(a, b)
#define MOD 1000000007

using namespace std;

ll a[1234567];

int main()
{
    ios_base::sync_with_stdio(0);
    //fpeopen("input.txt", "r", stdin);
    //fpeopen("output.txt", "r", stdout);
    long long  n;
    cin >> n;
    ll sum = 0;
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    sort(a, a + n);
    long long verh = sum;
    long long niz = n;
    int counter = 1-n;
    for(int i = 0; i < n; ++i)
    {
        verh += 2*a[i] * counter;
        counter += 2;
    }
    for(int i = N; i >= 2; --i)
    {
        if(niz % i == 0 && verh % i == 0)
        {    niz /= i; verh /= i; }
    }
    cout << verh << " " << niz;
    //system("pause");
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <set>
#include <cmath>
#include <map>
#include <list>
#include <algorithm>
#include <stack>
#include <functional>
#include <fstream>
#include <deque>
#include <queue>
#include <iostream>
#include <fstream>
#include <ctime>
#include <sstream>
#include <climits>

#define N 100003
#define PI 3.1415926535
#define EPS 0.00000001
#define MAX 1e9
#define MIN -(1e9)
#define ll long long
#define pii pair<int,int>
#define pll pair<long long, long long>
#define fori(i,n) for(int (i) = 0; (i) < n; ++(i))
#define forin(i, n) for(int (i) = n-1; i >= 0; --(i))
#define mp(a, b) make_pair(a, b)
#define MOD 1000000007

using namespace std;

ll a[1234567];

int main()
{
    ios_base::sync_with_stdio(0);
    //fpeopen("input.txt", "r", stdin);
    //fpeopen("output.txt", "r", stdout);
    long long  n;
    cin >> n;
    ll sum = 0;
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
        sum += a[i];
    }

    sort(a, a + n);
    long long verh = sum;
    long long niz = n;
    int counter = 1-n;
    for(int i = 0; i < n; ++i)
    {
        verh += 2*a[i] * counter;
        counter += 2;
    }
    for(int i = 2; i <= N; ++i)
    {
        if(niz % i == 0 && verh % i == 0)
        {    niz /= i; verh /= i; }
    }
    cout << verh << " " << niz;
    //system("pause");
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <memory.h>
#include <cassert>
#include <time.h>
using namespace std;
#pragma comment(linker, "/STACK:20000000")

typedef vector<int> vi;
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()

string problem_name = "a";

void init(){
  freopen((problem_name+".in").c_str(),"rt",stdin);
 // freopen((problem_name+".out").c_str(),"wt",stdout);
}

long long sum=0;

int mas[100100];

long long gcd(long long a, long long b)
{
    if (a==0) return b;
    return gcd(b%a,a);
}
long long dp[100100];

int main()
{

  //  init();

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

    for (int i=0;i<n;i++)
        scanf("%d",&mas[i]);

    sort(mas,mas+n);

    long long add=0;

    for (int i=0;i<n;i++){
        //scanf("%d",&mas[i]);
        if (i)
            sum+=(mas[i]-mas[i-1]) * (i)*(long long)(n-i);
        //if (i) dp[i] = (i-1) * ((mas[i]-mas[i-1]) + dp[i-1]);

        //for (int j=0;j<i;j++)
            //sum+=abs(mas[i]-mas[j]);
    }
    long long sum2=0;

    for (int i=0;i<n;i++)
        sum2+=mas[i];

    long long a = sum*(n-1)*2 + sum2*(n-1);
    long long b = n*(long long)(n-1);
    long long g = gcd(a,b);
    a/=g;
    b/=g;

    cout << a << " " << b;

    return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <memory.h>
#include <cassert>
#include <time.h>
using namespace std;
#pragma comment(linker, "/STACK:20000000")

typedef vector<int> vi;
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()

string problem_name = "a";

void init(){
  freopen((problem_name+".in").c_str(),"rt",stdin);
 // freopen((problem_name+".out").c_str(),"wt",stdout);
}

long long sum=0;

int mas[100100];

long long gcd(long long a, long long b)
{
	if (a==0) return b;
	return gcd(b%a,a);
}
long long dp[100100];

int main()
{

   // init();

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

	for (int i=0;i<n;i++)
		scanf("%d",&mas[i]);

	sort(mas,mas+n);

	long long add=0;
	for (int i=0;i<n;i++){
		//scanf("%d",&mas[i]);
		if (i) sum+=(mas[i]-mas[i-1]) * (i)*(n-i);
		//if (i) dp[i] = (i-1) * ((mas[i]-mas[i-1]) + dp[i-1]);

		//for (int j=0;j<i;j++)
			//sum+=abs(mas[i]-mas[j]);
	}
	long long sum2=0;

	for (int i=0;i<n;i++)
		sum2+=mas[i];

	long long a = sum*(n-2)*4 + sum2*(n-1);
	long long b = n*(long long)(n-1);
	long long g = gcd(a,b);
	a/=g;
	b/=g;

	cout << a << " " << b;

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <memory.h>
#include <cassert>
#include <time.h>
using namespace std;
#pragma comment(linker, "/STACK:20000000")

typedef vector<int> vi;
#define sz(a) int((a).size())
#define all(c) (c).begin(),(c).end()

string problem_name = "a";

void init(){
  freopen((problem_name+".in").c_str(),"rt",stdin);
 // freopen((problem_name+".out").c_str(),"wt",stdout);
}

long long sum=0;

int mas[100100];

long long gcd(long long a, long long b)
{
    if (a==0) return b;
    return gcd(b%a,a);
}
long long dp[100100];

int main()
{

  //  init();

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

    for (int i=0;i<n;i++)
        scanf("%d",&mas[i]);

    sort(mas,mas+n);

    long long add=0;
    for (int i=0;i<n;i++){
        //scanf("%d",&mas[i]);
        if (i)
            sum+=(mas[i]-mas[i-1]) * (i)*(long long)(n-i);
        //if (i) dp[i] = (i-1) * ((mas[i]-mas[i-1]) + dp[i-1]);

        //for (int j=0;j<i;j++)
            //sum+=abs(mas[i]-mas[j]);
    }
    long long sum2=0;

    for (int i=0;i<n;i++)
        sum2+=mas[i];

    long long a = sum*2 + sum2;
    long long b = n;
    long long g = gcd(a,b);
    a/=g;
    b/=g;

    cout << a << " " << b;

    return 0;
}


#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:64000000")

typedef long long ll;
const ll MAXLL = 0x0FFFFFFFFFFFFFFFll;
const int MAXINT = 0x0FFFFFFF;

const int MAXN = 100005;

int n;
ll a[MAXN];

int main()
{
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];
    sort(a,a+n);

    ll s=0;

    for(int i=0;i<n;i++)
    {
        int let = i-(n-i-1);
        s += 2*a[i]*let;
        s += a[i];
    }

    for(int i=2;i<=n;i++)
        while(s%i==0&&n%i==0)
        {
            s/=i;
            n/=i;
        }
    cout << s << ' ' << n << '\n';

    return 0;
}


#include <iostream>
#include <algorithm>
#include <iterator>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <cmath>
using namespace std;
#pragma comment(linker, "/STACK:64000000")

typedef long long ll;
const ll MAXLL = 0x0FFFFFFFFFFFFFFFll;
const int MAXINT = 0x0FFFFFFF;

const int MAXN = 100005;

int n;
ll a[MAXN];

int main()
{
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i];

    ll s=0;

    for(int i=0;i<n;i++)
    {
        int let = i-(n-i-1);
        s += 2*a[i]*let;
        s += a[i];
    }

    for(int i=2;i<=n;i++)
        while(s%i==0&&n%i==0)
        {
            s/=i;
            n/=i;
        }
    cout << s << ' ' << n << '\n';

    return 0;
}


#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

long long gcd(long long a, long long b) {
	while (b != 0) {
		long long t = a % b;
		a = b;
		b = t;
	}
	return a;
}

int main() {
	int n;
	scanf("%d", &n);
	vector <int> a(n);
	long long sum = 0;
	for (int i = 0; i < n; i++) {
		scanf("%d", &a[i]);
		sum += a[i];
	}
	sort(a.begin(), a.end());
	long long s = 0;
	long long cur = 0;
	for (int i = 1; i < n; i++) {
		cur += (long long)(a[i] - a[i - 1]) * i;
		s += cur;
	}
	long long _gcd = gcd(sum + 2 * s, n);
	printf("%I64d %I64d", (sum + 2 * s) / _gcd, (long long)n / _gcd);
	return 0;
}


#pragma comment(linker, "/STACK:33554432")

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <memory.h>

using namespace std;

typedef long long LL;
typedef vector<int> vint;

int n;
int a[1 << 17];

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

int main()
{
	scanf("%d", &n);
	for(int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	sort(a, a + n);
	LL res = 0;
	for(int i = 0; i < n - 1; ++i)
		res += (LL)(i + 1) * (n - i - 1) * (a[i + 1] - a[i]);
	res *= 2;
	for(int i = 0; i < n; ++i)
		res += a[i];
	LL d = gcd(res, n);
	res /= d;
	n /= d;
	printf("%I64d %d\n", res, n);
	return 0;
}


// In the Name Of God

#include <iostream>
#include <sstream>
#include <cmath>
#include <iomanip>
#include <string>
#include <cstring>
#include <bitset>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>

#define inf (int)(~0u/2)
#define ll_inf (int)1 << 62
#define int long long
#define float long double
#define fillArr( n, a )  for ( int i=0; i<n; i++ ) cin >> a[i] ;
#define fillArr2( n, a, b ) for ( int i=0; i<n; i++ ) cin >> a[i] >> b[i];
#define for2(i, a1, a2) for ( int (i) = (a1); (i)<(a2); (i)++ )
#define mp( a, b ) make_pair ( a, b )
#define add( a, b ) a.push_back ( b )
#define sz(a) (int) a.size( )
#define print(a) cout << #a << endl
#define log(a) cerr << #a << " " << a << endl
using namespace std;

int a[100011];

int gcd ( int a, int b ){
	if ( !b ) return a;
	return gcd ( b, a%b );
}

void main ( ){
	int n;
	cin >> n;
	fillArr ( n, a );
	sort ( a, a + n );
	int t = a[0];
	for2 ( i, 1, n )
		t = gcd ( t, a[i] );
//	for2 ( i, 0, n )
	//	a[i] /= t;
	int sum = 0;
	for2 ( i, 0, n )
		sum += a[i];
	int s2 =0, s3 = 0;
	for2 ( i, 0, n ){
		s3 += a[i];
		s2 += abs((i+1)*a[i] - s3)*2;
	}
	t = gcd ( s2+sum, n );
	cout << (s2+sum)/t << " " << n/t << endl;
}


#include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <set>
#include <queue>
#include <sstream>
#include <deque>
#include <memory.h>
#include <cassert>
#include <ctime>

using namespace std;

#define ll long long
#pragma comment(linker, "/STACK:64000000")

const int maxn = 1 << 17;
const int inf = 1000000007;
const int mod = 1000000007;

int n;
int a[maxn];

ll gcd(ll a, ll b) {
	while (b) b ^= a ^= b ^= a %= b;
	return a;
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a, a + n);

	ll ansa = 0, ansb = n, sum = 0;
	for (int i = 0; i < n; i++) {
		ansa += 2 * (1LL * i * a[i] - sum);
		sum += a[i];
	}
	for (int i = 0; i < n; i++) ansa += a[i];
	ll g = gcd(ansa, ansb);
	ansa /= g;
	ansb /= g;
	cout << ansa << " " << ansb << endl;

	return 0;
}


#include <stdio.h>
#include <algorithm>
#include <vector>
#include <iostream>

using namespace std;

#define ab(x) ((x)<0?-(x):(x))
#define ll long long
ll a[100005];
int n;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int main(){
	int i,j;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	ll A,B;
	A=B=0;
	ll now=0;
	for(int i=0;i<n;i++){
		A+=(a[i]*i-now)*2;
		now+=a[i];
	}

	for(int i=0;i<n;i++)A+=a[i];

	B=n;

	ll G=gcd(A,B);
	A/=G;
	B/=G;

	cout<<A<<" "<<B<<endl;
}


#include <stdio.h>
#include <algorithm>
#include <vector>
#include <iostream>

using namespace std;

#define ll long long
ll a[100005];
int n;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll A,B,sum;

int main(){
	int i,j;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);

	for(int i=0;i<n;i++){
		A+=(a[i]*i-sum)*2;
		sum+=a[i];
	}
	for(int i=0;i<n;i++)A+=a[i];

	B=n;

	ll G=gcd(A,B);
	A/=G;
	B/=G;

	cout<<A<<" "<<B<<endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <string.h>
#include <ctime>
#include <limits.h>
using namespace std;

typedef long long ll;
const double pi=acos(-1.0);
const double eps=1e-11;
//const ll INF=(_I64_MAX)/2;
//#pragma comment(linker, "/STACK:102400000,102400000")
const int inf=0x3f3f3f3f;
#define maxx(a) memset(a, 0x3f, sizeof(a))
#define zero(a) memset(a, 0, sizeof(a))
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) for(i = n-1;i>=0;i--)
#define srep(i,n) for(i = 1;i <= n;i ++)
#define snuke(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MP make_pair
typedef pair<int,int> PII;

const int N = 1e6+ 111;
const int mod = 1e9 + 7;

ll gcd(ll a,ll b) {
     return b ? gcd(b,a % b) : a;
}

int k[N];
void play(){
    int n,i,j;
    cin>>n;
    ll ans = 0;
    rep(i,n) {
        scanf("%d",k+i);
        ans += k[i];
    }
    sort(k,k+n);
    ll tp = 0;
    rep(i,n){
        ans += 2*((ll)k[i]*(ll)(i) - tp);
        tp += k[i];
    }
    ll x = gcd(ans,n);
    cout<<ans/x<<' '<<n/x;

}

int main()
{
#ifndef ONLINE_JUDGE
     freopen("in.txt","r",stdin);
     // freopen("out.txt","w",stdout);
#endif

     play();

#ifndef ONLINE_JUDGE
     cerr << "time = " << clock() << " ms" << endl;
#endif

     return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <string.h>
#include <ctime>
#include <limits.h>
using namespace std;

typedef long long ll;
const double pi=acos(-1.0);
const double eps=1e-11;
//const ll INF=(_I64_MAX)/2;
//#pragma comment(linker, "/STACK:102400000,102400000")
const int inf=0x3f3f3f3f;
#define maxx(a) memset(a, 0x3f, sizeof(a))
#define zero(a) memset(a, 0, sizeof(a))
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) for(i = n-1;i>=0;i--)
#define srep(i,n) for(i = 1;i <= n;i ++)
#define snuke(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define MP make_pair
typedef pair<int,int> PII;

const int N = 1e6+ 111;
const int mod = 1e9 + 7;

ll gcd(ll a,ll b) {
     return b ? gcd(b,a % b) : a;
}

int k[N];
void play(){
	int n,i,j;
	cin>>n;
	ll ans = 0;
	rep(i,n) {
		scanf("%d",k+i);
		ans += k[i];
	}
	ll tp = 0;
	rep(i,n){
		ans += 2*((ll)k[i]*(ll)(i) - tp);
		tp += k[i];
	}
	ll x = gcd(ans,n);
	cout<<ans/x<<' '<<n/x;

}

int main()
{
#ifndef ONLINE_JUDGE
     freopen("in.txt","r",stdin);
     // freopen("out.txt","w",stdout);
#endif

	 play();

#ifndef ONLINE_JUDGE
     cerr << "time = " << clock() << " ms" << endl;
#endif

     return 0;
}


#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <string>

using namespace std;

long long a[200000],s,q;
int n,i;

long long gcd(long long a,long long b)
{
    if(a && b)while(a%=b^=a^=b^=a);
    return a+b;
}

int main()
{
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
    sort(a,a+n);
    q=a[0];
    for(i=1;i<n;i++)
    {
        s+=a[i]*i-q;
        q+=a[i];
    }
    s*=2;
    s+=q;
    q=gcd(s,n);
    printf("%lld %lld\n",s,n);
    return 0;
}


#define _USE_MATH_DEFINES
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
#include <string>

using namespace std;

long long a[200000],s,q;
int n,i;

long long gcd(long long a,long long b)
{
    if(a && b)while(a%=b^=a^=b^=a);
    return a+b;
}

int main()
{
    scanf("%d",&n);
    for(i=0;i<n;i++)
        scanf("%lld",&a[i]);
    sort(a,a+n);
    q=a[0];
    for(i=1;i<n;i++)
    {
        s+=a[i]*i-q;
        q+=a[i];
    }
    s*=2;
    s+=q;
    q=gcd(s,n);
    printf("%lld %lld\n",s/q,n/q);
    return 0;
}


#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <limits>
using namespace std;

long long a[100005];
int n;
long long num, den;

long long getStart ()
{
	long long sum = 0;

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

	return sum;
}

long long getAll ()
{
	long long sum = 0;

	for (int i = 1, l = 1, r = n - 1; i < n; i++, l++, r--)
	{
		sum += (a[i] - a[i - 1] ) * 1LL * l * 1LL * r;
	}

	return sum * 2;
}

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

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

	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%I64d", &a[i] );
	}

	long long res1 = getStart();
	long long res2 = getAll();

	num = a[0] * n + res1 + res2;
	den = n;

	long long g = gcd(num, den);
	num /= g;
	den /= g;

	printf("%I64d %I64d", num, den);

	return 0;
}


#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <limits>
using namespace std;

long long a[100005];
int n;
long long num, den;

long long getStart ()
{
	long long sum = 0;

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

	return sum;
}

long long getAll ()
{
	long long sum = 0;

	for (int i = 1, l = 1, r = n - 1; i < n; i++, l++, r--)
	{
		sum += (a[i] - a[i - 1] ) * 1LL * l * 1LL * r;
	}

	return sum * 2;
}

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

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

	scanf("%d", &n);
	for (int i = 0; i < n; i++)
	{
		scanf("%I64d", &a[i] );
	}
	sort(a, a + n);

	long long res1 = getStart();
	long long res2 = getAll();

	num = a[0] * n + res1 + res2;
	den = n;

	long long g = gcd(num, den);
	num /= g;
	den /= g;

	printf("%I64d %I64d", num, den);

	return 0;
}


#define _CRT_SECURE_NO_DEPRECATE

#pragma comment(linker,"/STACK:267386880")

#include <iostream>
#include <functional>
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>
#include <iterator>
#include <bitset>
#include <sstream>
#include <numeric>
#include <complex>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pdd pair<long double,long double>
#define LL long long
#define ULL unsigned LL
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); ++i)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,(LL)(a)-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define C(a) memset((a),0,sizeof (a))
#define MS(a,x) memset((a),(x),sizeof (a))
#define INF 1000000000
#define PI 3.141592653589
#define eps 1e-7
#define MOD 10007
#define PRIME 1000003

using namespace std;

LL gcd(LL a, LL b)
{
    return b ? gcd(b,a%b) : a;
}

int main()
{
#ifndef ONLINE_JUDGE
    {
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    }
#endif
    int n;
    scanf("%d",&n);
    VI d(n);
    rept(i,n)
        scanf("%d",&d[i]);
    sort(all(d));
    LL ans(0);
    LL tmp(d[0]);
    FOR(i,1,n-1)
    {
        ans+=(i*1ll*d[i]-tmp);
        tmp+=d[i];
    }
    ans*=2;
    ans+=tmp;
    LL g(gcd(ans,n));
    ans/=g;
    printf("%I64d %I64d\n",ans,n/g);
    return 0;
}


#define _USE_MATH_DEFINES

#include <cstdio>
#include <iostream>
#include <fstream>
#include <climits>
#include <ctime>
#include <cassert>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring> // for memset
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

#define INF INT_MAX
#define LINF LLONG_MAX
#define EPS 1e-9
#define MOD 1000000007 // 10**9 + 7
#define MAXN 100001
#define ALPH 26 // Latin alphabet size
#define DALPH 52 // Double Latin alphabet size

#define mp(a, b) make_pair(a, b)

typedef signed short int int16;
typedef unsigned short int uint16;
typedef unsigned long int uint;
typedef signed long long int int64;
typedef unsigned long long int uint64;
typedef long double real; // in msvc same as double

typedef pair<int, int> pii;

int n;
vector<int> list;

int64 gcd(int64 a, int64 b) {
    return b ? gcd(b, a % b) : a;
}

int main() {
    #ifdef _DEBUG
        assert(freopen("input.txt", "r", stdin));
        assert(freopen("output.txt", "w", stdout));
    #endif

    scanf("%d", &n);
    list.resize(n + 1, 0);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &list[i]);

    sort(list.begin(), list.end());

    int64 sum = 0;
    for (int i = 1; i <= n; ++i)
        sum += list[i];

    int64 nsum = 0;
    for (int i = 1; i <= n; ++i)
        nsum += 1ll * list[i] * (2 * i - n - 1);

    sum += nsum * 2;
    int64 G = gcd(sum, n);

    printf("%I64d %I64d\n", sum / G, n / G);
}


#define _USE_MATH_DEFINES

#include <cstdio>
#include <iostream>
#include <fstream>
#include <climits>
#include <ctime>
#include <cassert>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring> // for memset
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>

using namespace std;

#define INF INT_MAX
#define LINF LLONG_MAX
#define EPS 1e-9
#define MOD 1000000007 // 10**9 + 7
#define MAXN 100001
#define ALPH 26 // Latin alphabet size
#define DALPH 52 // Double Latin alphabet size

#define mp(a, b) make_pair(a, b)

typedef signed short int int16;
typedef unsigned short int uint16;
typedef unsigned long int uint;
typedef signed long long int int64;
typedef unsigned long long int uint64;
typedef long double real; // in msvc same as double

typedef pair<int, int> pii;

int n;
vector<int> list;

int64 gcd(int64 a, int64 b) {
    return b ? gcd(b, a % b) : a;
}

int main() {
    #ifdef _DEBUG
        assert(freopen("input.txt", "r", stdin));
        assert(freopen("output.txt", "w", stdout));
    #endif

    scanf("%d", &n);
    list.resize(n + 1, 0);
    for (int i = 1; i <= n; ++i)
        scanf("%d", &list[i]);

    sort(list.begin(), list.end());

    int64 sum = 0;
    for (int i = 1; i <= n; ++i)
        sum += list[i];

    int64 nsum = 0;
    for (int i = 2; i <= n; ++i)
        nsum += list[i] * (i - 1);

    for (int i = 1; i < n; ++i)
        nsum -= list[i] * (n - i);

    sum += nsum * 2;
    int64 G = gcd(sum, n);

    printf("%I64d %I64d\n", sum / G, n / G);
}


#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cassert>

using namespace std;

template <class T> T sqr(T x) { return x*x; }

const int INF = 1000*1000*1000;
const long long INF64 = sqr(static_cast<long long>(INF));
const double PI = acos(-1.0);

typedef long long ll;

const int N = 100500;

ll gcd(ll a, ll b)
{
	return a ? gcd(b % a, a) : b;
}

int n;
int a[N];
ll num, acc;

int main()
{
#ifdef _DEBUG
    assert(freopen("input.txt", "r", stdin));
    assert(freopen("output.txt", "w", stdout));
#endif
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	sort(a, a+n);
	for (int i = 0; i < n; ++i)
	{
		if (i != 0)
			acc += i * ((ll)(a[i]-a[i-1]));
		num += a[i] + 2 * acc;
	}
	ll g = gcd(num, n);
	cout << num / g << " " << n / g << endl;
    return 0;
}


#include <stdio.h>
#include <math.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <algorithm>
#define ll long long
using namespace std;

ll gcd(ll a,ll b) {
    while(b!=0) {
        ll t=b;
        b=a%t;
        a=t;
    }
    return a;
}

int n;
ll a[111111];

int main() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    sort(a,a+n);

    ll summ=0;
    for(int i=0;i<n;i++) {
        summ+=a[i];
    }

    ll numerator = summ;

    ll summ_less=0;
    ll summ_greater=summ;
    for(int i=0;i<n;i++) {
        numerator+=(ll)i*a[i]-(ll)summ_less;
        numerator+=(ll)summ_greater-(ll)(n-i)*a[i];
        summ_less+=a[i];
        summ_greater-=a[i];
    }

    ll denominator = n;

    //solvebrute();

    cout << numerator/gcd(numerator,denominator) << " " <<  denominator/gcd(numerator,denominator) << endl;
}


#include <stdio.h>
#include <math.h>
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#define ll long long
using namespace std;

ll gcd(ll a,ll b) {
    while(b!=0) {
        ll t=b;
        b=a%t;
        a=t;
    }
    return a;
}

int n;
ll a[111111];

int main() {
    cin>>n;
    for(int i=0;i<n;i++) {
        cin>>a[i];
    }
    sort(a,a+n);

    ll summ=0;
    for(int i=0;i<n;i++) {
        summ+=a[i];
    }

    ll numerator = summ;

    ll summ_less=0;
    ll summ_greater=summ;
    for(int i=0;i<n;i++) {
        numerator+=(ll)i*a[i]-(ll)summ_less;
        numerator+=(ll)summ_greater-(ll)(n-i)*a[i];
        summ_less+=a[i];
        summ_greater-=a[i];
    }

    ll denominator = n;

    //solvebrute();

    cout << numerator/gcd(numerator,denominator) << " " <<  denominator/gcd(numerator,denominator) << endl;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <algorithm>
#include <assert.h>

using namespace std;

int main()
{
#ifdef TEST
	freopen("input.txt", "r", stdin );
	freopen("output.txt", "w", stdout );
#endif
	int n;
	while( cin >> n ) {
		vector<long long> nums( n );
		for( int i = 0; i < n; i++ ) {
			cin >> nums[i];
		}
		sort( nums.begin(), nums.end() );
		long long ans = 0;
		for( int i = 0; i < n; i++ ) {
			ans += nums[i];
			ans += 2 * i * nums[i];
			ans += 2 * ( i - n + 1 ) * nums[i];
		}
		long long den = n;

		for( int i = 2; i <= den; i++ ) {
			while( i <= den && i <= ans && den % i == 0 && ans % i == 0 ) {
				den /= i;
				ans /= i;
			}
		}
		cout << ans << " " << den << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <algorithm>
#include <assert.h>

using namespace std;

int main()
{
#ifdef TEST
	freopen("input.txt", "r", stdin );
	freopen("output.txt", "w", stdout );
#endif
	int n;
	while( cin >> n ) {
		vector<long long> nums( n );
		for( int i = 0; i < n; i++ ) {
			cin >> nums[i];
		}
		sort( nums.begin(), nums.end() );
		long long ans = 0;
		for( int i = 0; i < n; i++ ) {
			ans += nums[i];
			ans += 2 * i * nums[i];
			ans += 2 * ( i - n + 1 ) * nums[i];
		}
		long long den = n;

		for( int i = 2; i < den; i++ ) {
			while( i < den && i < ans && den % i == 0 && ans % i == 0 ) {
				den /= i;
				ans /= i;
			}
		}
		cout << ans << " " << den << endl;
	}
	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <set>
#include <algorithm>
#include <assert.h>

using namespace std;

int main()
{
#ifdef TEST
	freopen("input.txt", "r", stdin );
	freopen("output.txt", "w", stdout );
#endif
	int n;
	while( cin >> n ) {
		vector<long long> nums( n );
		for( int i = 0; i < n; i++ ) {
			cin >> nums[i];
		}
		sort( nums.begin(), nums.end() );
		long long ans = 0;
		for( int i = 0; i < n; i++ ) {
			ans += nums[i];
			ans += 2 * i * nums[i];
			ans += 2 * ( i - n + 1 ) * nums[i];
		}
		long long den = n;

		for( int i = 2; i < den; i++ ) {
			if( i < den && i < ans && den % i == 0 && ans % i == 0 ) {
				den /= i;
				ans /= i;
			}
		}
		cout << ans << " " << den << endl;
	}
	return 0;
}


#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

#define r(n) scanf("%d", &n)
#define w(n) printf("%d\n", n)
#define FOR(i, n) for(int i=0; i<(n); ++i)
#define REP(i, a, b) for(int i=(a); i<(b); ++i)
#define mp(a, b) make_pair((a), (b))
#define ll long long

#define maxn 100005

int n;
int A[maxn];

ll GSD(ll a, ll b)
{
	if (b == 0) return a;
	if (a == 0) return b;
	if (a >= b) return GSD(b, a%b); else return GSD(a, b%a);
}

int main()
{
	r(n);
	FOR(i, n) r(A[i]);
	sort(A, A+n);
	ll ans = 0;
	FOR(i, n) ans += (ll)A[i] * (ll)(4*(i+1) - 1 - 2*n);

	ll gsd = GSD(ans, n);
	ans /= gsd;
	n /= gsd;

	cout<<ans<<" "<<n<<endl;

}


#pragma comment(linker, "/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <stdlib.h>
#include <string>
//#include <string.h>
#include <list>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <set>
#include <stack>

//#include <sstream>
//#include "Biginteger.cpp"
//#include "sqrt.cpp"
//#include "tree.cpp"
//#include "funcs.cpp"

#define ll long long
#define ALL(x)           (x).begin(), (x).end()
#define forn(N)          for(ll i = 0; i<N; i++)
#define fornj(N)         for(ll j = 0; j<N; j++)
#define fornk(N)         for(ll k = 0; k<N; k++)
#define PI 3.1415926535897932384626433
#define INF 2147483647
#define MOD 1000000007
#define File "paint"
using namespace std;

ll GCD(ll x, ll y)
{
	if (y==0) return x;
	return GCD(y, x%y);
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	#else
	//freopen(File".in", "r", stdin); freopen(File".out", "w", stdout);
	#endif

	int N; cin>>N;
	vector<ll> A(N);
	vector<ll> DP(N);
	forn(N) cin>>A[i];
	sort(ALL(A));
	for(ll i = 1; i<N; i++)
	{
		DP[i] = DP[i-1] + (A[i]-A[i-1])*i;
	}
	ll ans = 0, sum=0;
	forn(N)
	{
		ans+=DP[i];
	}
	for(int i = 0; i<N; i++)
	{
		sum+=A[i];
	}
	ans = 2*ans+sum;
	cout<<ans/(GCD(ans,N))<<" "<<N/(GCD(ans,N));

	//printf("\n\ntime-%.3lf", clock()*1e-3);
	return 0;
}


#pragma comment(linker, "/STACK:16777216")
#include <iostream>
#include <cstdio>
#include <stdio.h>
#include <cstdlib>
#include <stdlib.h>
#include <string>
//#include <string.h>
#include <list>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <set>
#include <stack>

//#include <sstream>
//#include "Biginteger.cpp"
//#include "sqrt.cpp"
//#include "tree.cpp"
//#include "funcs.cpp"

#define ll long long
#define ALL(x)           (x).begin(), (x).end()
#define forn(N)          for(ll i = 0; i<N; i++)
#define fornj(N)         for(ll j = 0; j<N; j++)
#define fornk(N)         for(ll k = 0; k<N; k++)
#define PI 3.1415926535897932384626433
#define INF 2147483647
#define MOD 1000000007
#define File "paint"
using namespace std;

ll GCD(ll x, ll y)
{
	if (y==0) return x;
	return GCD(y, x%y);
}
int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	#else
	//freopen(File".in", "r", stdin); freopen(File".out", "w", stdout);
	#endif

	int N; cin>>N;
	vector<ll> A(N);
	vector<ll> DP(N);
	forn(N) cin>>A[i];

	for(int i = 1; i<N; i++)
	{
		DP[i] = DP[i-1] + (A[i]-A[i-1])*i;
	}
	ll ans = 0, sum=0;
	forn(N)
	{
		ans+=DP[i];
	}
	for(int i = 0; i<N; i++)
	{
		sum+=A[i];
	}
	ans = 2*ans+sum;
	cout<<ans/(GCD(ans,N))<<" "<<N/(GCD(ans,N));

	//printf("\n\ntime-%.3lf", clock()*1e-3);
	return 0;
}


#include <iostream>
#include <algorithm>

using namespace std;

long long A[100005], res = 0, Sumfor, Sumall = 0;

long long gcd(long long a, long long b)
{
	while(b != 0)
	{
		long long temp = a % b;
		a = b;
		b = temp;
	}
	return a;
}

int main()
{
//	freopen("input.txt","r",stdin);
//	freopen("output.txt","w",stdout);
	int n;
	cin >> n;
	for(int i = 0; i < n; i++)
	{
		scanf("%d",&A[i]);
		Sumall += A[i];
	}
	sort(A, A+n);
	res += Sumall;
	Sumfor = A[0];
	for(long long i = 1; i < n; i++)
	{
		res += (i*A[i] - Sumfor)*2;
		Sumfor += A[i];
	}
	long long gc = gcd(res, n);
	cout << res / gc << " " << n / gc << endl;
//	fclose(stdin);
//	fclose(stdout);
	return 0;
}


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

using namespace std;

long long gcd(long long a, long long b)
{
    if (b == 0)
        return a;
    else
        return gcd(b, a % b);
}

int main()
{
    int n, i;
    long long sum = 0;
    long long sumpairs = 0, ans, d;
    cin >> n;
    vector <long long> A(n);
    for (i = 0; i < n; ++i)
        cin >> A[i];
    sort(A.begin(), A.end());
    for (i = 0; i < n; ++i)
    {
        sumpairs += A[i] * i - sum;
        sum += A[i];
    }
    ans = sum + 2 * sumpairs;
    d = gcd(ans, n);
    cout << ans / d << " " << n / d << endl;
    return 0;
}