#include <bits/stdc++.h>
using namespace std;
long long A[100005], P[100005], N, S;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    S += A[i];
  }
  sort(A, A + N);
  for (int i = 1; i < N; i++) {
    P[i] = P[i - 1] + (A[i] - A[i - 1]) * (i);
    S += 2 * P[i];
  }
  long long g = gcd(N, S);
  N /= g;
  S /= g;
  cout << S << " " << N;
}
