#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
int a[maxn];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int main() {
  long long ret = 0;
  long long n, x, s = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; ++i) {
    x = a[i];
    ret += x + (x * (i - 1) - s) * 2;
    s += x;
  }
  long long g = gcd(ret, n);
  cout << ret / g << " " << n / g << endl;
  return 0;
}
