#include <bits/stdc++.h>
using namespace std;
int N;
int A[100010];
long long gcd(long long a, long long b) {
  long long r;
  while (b) b = (r = a % b, a = b, r);
  return a;
}
int main() {
  long long sum = 0, s = 0;
  scanf("%d", &N);
  for (int i = 1; i <= N; ++i) scanf("%d", &A[i]);
  sort(A + 1, A + N + 1);
  for (int i = 1; i <= N; ++i) {
    s += 2LL * (1LL * A[i] * (i - 1) - sum);
    sum += A[i];
    s += 1LL * A[i];
  }
  long long r = gcd(s, N);
  cout << s / r << " " << N / r << endl;
  return 0;
}
