#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long x, y, z;
  if (a < b) {
    x = a;
    y = b;
  } else {
    x = b;
    y = a;
  }
  while (x > 0) {
    z = x;
    x = y % x;
    y = z;
  }
  return y;
}
int main() {
  long long a[100005], num, g, i, n;
  scanf("%I64d", &n);
  num = a[0] = 0;
  for (i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n + 1);
  for (i = 0; i < n; i++) {
    num += (a[i + 1] - a[i]) * ((2 * n + 1) * i - 2 * (1 + i) * i + n);
  }
  g = gcd(num, n);
  printf("%I64d %I64d\n", num / g, n / g);
  return 0;
}
