#include <bits/stdc++.h>
using namespace std;
template <typename T>
int sgn(T val) {
  return (T(0) < val) - (val < T(0));
}
long long int greatestCommonDivisor(long long int m, long long int n) {
  long long int r;
  if ((m == 0) || (n == 0))
    return 0;
  else if ((m < 0) || (n < 0))
    return -1;
  do {
    r = m % n;
    if (r == 0) break;
    m = n;
    n = r;
  } while (true);
  return n;
}
int main() {
  long long int n;
  cin >> n;
  vector<long long int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr.begin(), arr.end());
  long long int ans = 0, sum = 0, y = -(n - 1);
  for (int i = 1; i <= n; i++) {
    sum += arr[i - 1];
    ans += y * arr[i - 1];
    y += 2;
  }
  long long int x = n - 1, fact = 1;
  long long int gcd = greatestCommonDivisor(sum + ans * 2, n);
  cout << (sum + ans * 2) / gcd << " " << n / gcd << endl;
  return 0;
}
