#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:64000000")
const int maxn = 1 << 17;
const int inf = 1000000007;
const int mod = 1000000007;
int n;
int a[maxn];
long long gcd(long long a, long long b) {
  while (b) b ^= a ^= b ^= a %= b;
  return a;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long 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];
  long long g = gcd(ansa, ansb);
  ansa /= g;
  ansb /= g;
  cout << ansa << " " << ansb << endl;
  return 0;
}
