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