#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  if (b <= a) std::swap(a, b);
  while (a) {
    long long a0 = a;
    a = b % a0;
    b = a0;
  }
  return b;
}
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = (0); (i) < (n); ++(i)) cin >> a[i];
  sort(a.begin(), a.end());
  vector<long long> acc(n + 1);
  for (int i = (0); (i) < (n); ++(i)) acc[i + 1] = acc[i] + a[i];
  long long x = 0;
  for (int i = (0); (i) < (n); ++(i)) {
    x += a[i];
    x += acc[n] - acc[i] - (n - i) * a[i];
    x += -acc[i] + i * a[i];
  }
  long long z = gcd(x, n);
  cout << x / z << " " << n / z << endl;
  return 0;
}
