#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) {
  if (y == 0) {
    return x;
  }
  if (y > x) {
    return gcd(y, x);
  } else {
    return gcd(x % y, y);
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    long long t = a[i];
    t *= (i - (n - 1 - i));
    sum += t;
  }
  long long ch = 2 * sum;
  for (int i = 0; i < n; ++i) {
    ch += a[i];
  }
  long long zn = n;
  long long d = gcd(ch, zn);
  cout << (ch / d) << " " << (zn / d) << endl;
  return 0;
}
