#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long a[10000000];
int main() {
  long long temp, j, i, n, g;
  long long x;
  scanf("%I64d", &n);
  temp = 1 - n;
  j = 1;
  x = 0;
  j = 1;
  for (i = 0; i < n; i++) {
    scanf("%I64d", &a[i]);
  }
  std::sort(a, a + n);
  for (i = 0; i < n; i++) {
    x += (2 * a[i] * temp + a[i]);
    temp += 2;
  }
  g = gcd(x, n);
  while (g != 1) {
    x /= g;
    n /= g;
    g = gcd(x, n);
  }
  printf("%I64d %I64d\n", x, n);
  return 0;
}
