#include <bits/stdc++.h>
using namespace std;
vector<int> d;
long long sum, tmp, divi;
int N, i, x;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  scanf("%d", &N);
  d.resize(N + 1);
  d[0] = 0;
  for (i = 1; i <= N; i++) scanf("%d", &d[i]);
  sort(d.begin(), d.end());
  for (sum = 0, i = 1; i <= N; i++) {
    tmp = 2 * (d[i] - d[i - 1]);
    sum += tmp * (long long)(N - i + 1) * (long long)i;
  }
  for (i = 1; i <= N; i++) sum -= d[i];
  divi = gcd(sum, N);
  printf("%I64d %I64d\n", sum / divi, (long long)N / divi);
  return 0;
}
