#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  while (a) b %= a, swap(a, b);
  return b;
}
int n, a[1111111];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
  sort(a, a + n);
  long long s = 0, c = 0;
  for (int i = 0; i < n; ++i) {
    if (i) c += (a[i] - a[i - 1]) * 1LL * i;
    s += c + c;
    s += a[i];
  }
  long long g = gcd(s, n);
  if (g < 0) g = -g;
  s /= g;
  n /= g;
  cout << s << ' ' << n << endl;
  return 0;
}
