Iahub is a big fan of tourists. He wants to become a tourist himself, so he planned a trip. There are n destinations on a straight road that Iahub wants to visit. Iahub starts the excursion from kilometer 0. The n destinations are described by a non-negative integers sequence a_1, a_2, ..., a_{n}. The number a_{k} represents that the kth destination is at distance a_{k} kilometers from the starting point. No two destinations are located in the same place. 

Iahub wants to visit each destination only once. Note that, crossing through a destination is not considered visiting, unless Iahub explicitly wants to visit it at that point. Also, after Iahub visits his last destination, he doesn't come back to kilometer 0, as he stops his trip at the last destination. 

The distance between destination located at kilometer x and next destination, located at kilometer y, is |x - y| kilometers. We call a "route" an order of visiting the destinations. Iahub can visit destinations in any order he wants, as long as he visits all n destinations and he doesn't visit a destination more than once. 

Iahub starts writing out on a paper all possible routes and for each of them, he notes the total distance he would walk. He's interested in the average number of kilometers he would walk by choosing a route. As he got bored of writing out all the routes, he asks you to help him.


-----Input-----

The first line contains integer n (2 ≤ n ≤ 10^5). Next line contains n distinct integers a_1, a_2, ..., a_{n} (1 ≤ a_{i} ≤ 10^7).


-----Output-----

Output two integers — the numerator and denominator of a fraction which is equal to the wanted average number. The fraction must be irreducible.


-----Examples-----
Input
3
2 3 5

Output
22 3


-----Note-----

Consider 6 possible routes:  [2, 3, 5]: total distance traveled: |2 – 0| + |3 – 2| + |5 – 3| = 5;  [2, 5, 3]: |2 – 0| + |5 – 2| + |3 – 5| = 7;  [3, 2, 5]: |3 – 0| + |2 – 3| + |5 – 2| = 7;  [3, 5, 2]: |3 – 0| + |5 – 3| + |2 – 5| = 8;  [5, 2, 3]: |5 – 0| + |2 – 5| + |3 – 2| = 9;  [5, 3, 2]: |5 – 0| + |3 – 5| + |2 – 3| = 8. 

The average travel distance is $\frac{1}{6} \cdot(5 + 7 + 7 + 8 + 9 + 8)$ = $\frac{44}{6}$ = $\frac{22}{3}$.

Difficulty: interview

Starter code:

Solutions:
from fractions import *
def solve():
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans1 = 0
    pres = a[0]
    for i in range(1,n):
        ans1+=i*a[i] -pres
        pres+=a[i]
    ans1 *= 2;
    tmp = pres+ans1
    tmp1 = n
    s = Fraction(tmp,tmp1)
    print(s.numerator,s.denominator)

solve()

def gcd(a,b) : return a if b==0 else gcd(b,a%b)

n = int(input())
l = input().split()
l = [int(i) for i in l]
l.sort()
t = sum((i+i-n+1)*l[i] for i in range(n))
t = t+t+sum(l)
d = gcd(t,n)
print(t//d,n//d)


def gcd(a,b) : return a if b==0 else gcd(b,a%b)

n = int(input())
l = sorted(map(int, input().split()))
t = sum((i+i-n+1)*l[i] for i in range(n))
t = t+t+sum(l)
d = gcd(t,n)
print(t//d,n//d)


from fractions import Fraction

n = int(input())
l = [int(x) for x in input().split()]
l.sort()

f = Fraction(sum([(3-2*n+4*i)*l[i] for i in range(n)]),n)
print(f.numerator,f.denominator)

##import itertools
##tot2 = 0
##for i in itertools.permutations(l):
##    loc = 0
##    tot = 0
##    for e in i:
##        tot += abs(loc-e)
##        loc = e
##    #print(i,tot)
##    tot2 += tot
##import math
##f2 = Fraction(tot2,math.factorial(n))
##print(f2.numerator,f2.denominator)
##


from fractions import Fraction
while(1):
    try:
        n=int(input())
        a=list(map(int,input().split()))
        s=sum(a)
        a.sort()
        for i in range(0,n):
            s+=2*(2*i+1-n)*a[i]
        f=Fraction(s,n)
        print(f.numerator,end=' ')
        print(f.denominator)
    except EOFError:
        break

from fractions import *
n=int(input());
a=list(map(int,input().split()));
a=sorted(a);
now=a[0];
ans=0;
for i in range(1,n):
    ans+=i*a[i]-now;
    now=now+a[i];
ans=ans*2+now;
s=Fraction(ans,n);
print(s.numerator,s.denominator);

def gcd (n,m):
  if n % m == 0: return m
  return gcd (m, n%m)

n = int (eval(input ()))
a = list (map (int, input().split()))
a.sort()

s = a[0]
sleft = 0
for i in range (1,len(a)):
  sleft += (i*a[i] - s)
  s += a[i]

tot = s + sleft*2
print(tot//gcd(tot,n), n//gcd(tot,n))


def gcd(m, n): return m if n == 0 else gcd(n, m%n)

n = int(input())

a = sorted(map(int, input().split()))

cur = sum(a)
ans = cur
pre = 0

for i in range(n):
    cur += (i+i-n) * (a[i]-pre)
    ans += cur
    pre = a[i]

g = gcd(ans, n)

print(ans//g, n//g)


def gcd(a, b): return gcd(b % a, a) if a else b
n = int(input())
a = sorted(map(int, input().split()))
p, q = 0, n
for i in range(1, n): p += i * (n - i) * (a[i] - a[i - 1])
p = 2 * p + sum(a)
r = gcd(p, q)
print(p // r, q // r)


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n = int(input())
a = sorted(list(map(int, input().split())))

total_dist = 0
cur_sum = 0
cur_points = 0

for x in a[::-1]:
    total_dist += cur_sum - cur_points * x
    cur_sum += x
    cur_points += 1

total_dist *= 2
total_dist += sum(a)

high = total_dist
low = n
g = gcd(low, high)
print(high // g, low // g)


#!/usr/bin/env python3
def read_string():
    return input()
def read_strings(return_type = iter, split = None, skip = 0):
    return return_type(input().split(split)[skip:])
def read_lines(height, return_type = iter):
    return return_type(read_string() for i in range(height))
def read_number():
    return int(input())
def read_numbers(return_type = iter, skip = 0):
    return return_type(int(i) for i in input().split()[skip:])
def read_values(*types, array = None):
    line = input().split()
    result = []
    for return_type, i in zip(types, list(range(len(types)))):
        result.append(return_type(line[i]))
    if array != None:
        array_type, array_contained = array
        result.append(array_type(array_contained(i) for i in line[len(types):]))
    return result
def read_array(item_type = int, return_type = iter, skip = 0):
    return return_type(item_type(i) for i in input().split()[skip:])
def read_martix(height, **args):
    return_type = args["return_type"] if "return_type" in args else iter
    return_type_inner = args["return_type_inner"] if "return_type_inner" in args else return_type
    return_type_outer = args["return_type_outer"] if "return_type_outer" in args else return_type
    item_type = args["item_type"] if "item_type" in args else int
    return return_type_outer(read_array(item_type = item_type, return_type = return_type_inner) for i in range(height))
def read_martix_linear(width, skip = 0, item_type = int, skiped = None):
    num = read_array(item_type = item_type, skip = skip)
    height = len(num) / width
    return [num[i * width: (i + 1) * width] for i in range(height)]
def gcd(n, m):
    if m == 0:
        return n
    return gcd(m, n % m)
def main():
    n = read_number()
    arr = sorted(read_numbers(list))
    sum_x = sum(arr)
    sum_xy = 0
    for i in range(1, n):
        sum_xy += (arr[i] - arr[i - 1]) * i * (n - i)
    nu = sum_x + sum_xy * 2
    de = n
    g = gcd(nu, de)
    nu //= g
    de //= g
    print(nu, de)
def __starting_point():
    main()

__starting_point()

from fractions import gcd

n = int(input())
a = sorted([int(x) for x in input().split()])

ans = 0
l = 0
for i in range(n):
  ans += i * a[i] - l
  l += a[i]

ans = sum(a) + 2 * ans
g = gcd(ans, n)

print(ans // g, n // g)


def gcd(a,b) : return a if b==0 else gcd(b,a%b)



n = int(input())

l = input().split()

l = [int(i) for i in l]

l.sort()

t = sum((i+i-n+1)*l[i] for i in range(n))

t = t+t+sum(l)

d = gcd(t,n)

print(t//d,n//d)





# Made By Mostafa_Khaled


from fractions import *
n  =  int(input())

a = [int(x) for x in input().split()]
a.sort()
a1 = a[0]
lef_sum = 0
for i in range(1,n):
    lef_sum+= a[i]*i - a1 
    a1+=a[i]
    
lef_sum*=2
total = lef_sum+a1
s = Fraction(total,n)
print(s.numerator,s.denominator)



import fractions
x = int(input())
a = sorted(map(int, input().split()))
z = 2 * x + 1
ans = sum(((4 * i - z) * a[i - 1]) for i in range(1, x + 1, 1))
s = fractions._gcd(ans, x)
ans //= s; x //= s
ss = []
ss.append(ans); ss.append(x)
print(*ss)

import math
n=int(input())
l1=list(map(int,input().split()))
pre_sum=[0]
l1.sort()
for item in l1:
    pre_sum.append(pre_sum[-1]+item)
numerator=0
for i in range(n):
    numerator+= (l1[i]*(i+1))-pre_sum[i] +pre_sum[n]-pre_sum[i+1]- l1[i]*(n-1-i)
y=math.gcd(numerator,n)
print(numerator//y,n//y)



'''input
4
1 5 77 2
'''
from sys import stdin
import collections
import math


# main starts
n = int(stdin.readline().strip())
arr = list(map(int, stdin.readline().split()))
arr.sort()

numerator = sum(arr)
temp = 0
for i in range(n):
	temp  += i * arr[i]
for i in range(n - 1, -1, -1):
	temp -= arr[n - 1 - i] * i

numerator += 2 * temp
g = math.gcd(numerator, n)
print(numerator // g, n // g)


import math
t=int(input())
l=list(map(int,input().split()))
l.sort()
s=sum(l)
a=s
j=1
m=0
for i in l:
    s-=i
    m+=s-(t-j)*i
    j+=1
x=2*m+a
y=math.gcd(x,t)
x//=y
t//=y
print(x,t)

from math import gcd
 
n = int(input())
a = sorted(map(int, input().split()))
ans = 0
for i in range(n):
	ans += 2 * (i + i - n + 1) * a[i]
ans += sum(a)
tmp = gcd(ans, n)
print(ans // tmp, n // tmp)



import math
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
k = 0
s1 = 0
s2 = 0
for i in a:
	s2 += s1 - k * i
	s1 += i
	k += 1
s2 *= 2
s2 += sum(a)
gcd = math.gcd(s2, n)
print(s2 // gcd, n // gcd)



import math
 
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)

ans = 0
gg = 0
for i in range(n):
  ans += i * a[i] - gg
  gg += a[i]
 
ans = sum(a) + 2 * ans
g = math.gcd(ans, n)
ans//=g
n//=g
print(ans, n)



def gcd(a, b):
	if (b == 0):
		return a
	return gcd(b, a % b)


n = int(input())
a = sorted(list(map(int, input().split())),reverse = True)
k = 0
s1 = 0
s2 = 0
for i in a:
	s2 += s1 - k * i
	s1 += i
	k += 1
s2 *= 2
s2 += sum(a)
gc = gcd(s2, n)
print(s2 // gc, n // gc)



import math

def main():
    n = int(input())
    arr = list(map(int,input().split()))
    arr.sort()
    right = sum(arr)
    left = 0

    arr.insert(0,0)
    total = 0
    for i in range(1,n+1):
        left += arr[i]
        total += i*arr[i]-left
        total += right-(n-i)*arr[i]
        right -= arr[i]

    g = math.gcd(max(total,n),min(total,n))
    total = total//g
    n = n//g

    print(total,n)


main()


from fractions import Fraction
n=int(input())
a=[int(i) for i in input().split()]
a=sorted(a)
s=[]
s.append(0)
for i in range(n):
    s.append(s[-1]+a[i])
ans=0
for i in range(1,n+1):
    ans+=s[n]-s[i-1]-(n-i+1)*a[i-1]
ans=ans*2+sum(a)
ans=Fraction(ans,n)
print("{0:d} {1:d}".format(ans.numerator,ans.denominator))


def gcd(a,b):
    if b == 0:
        return a
    return gcd(b,a%b)
    
n = int(input())
a = [int(x) for x in input().split()]
sum1 = sum(a)
sum2 = 0
sumbefore = 0
a.sort()
for i in range(n):
    sum2 += a[i]*(i) - sumbefore
    sumbefore += a[i]
sumtot = sum1 + 2*sum2
k = gcd(sumtot,n)
print(sumtot//k,n//k)