#include <bits/stdc++.h>
using namespace std;
long long i, n, m, a, b, s[100001];
int main() {
  m = a = b = 0LL;
  cin >> n;
  for (i = 0; i < n; i++) cin >> s[i];
  sort(s, s + n);
  for (i = 0; i < n; i++) b += s[i], a += s[i] * (2 * i - n + 1) * 2;
  a = b = a + b;
  m = n;
  while (b % m != 0) {
    int t = b % m;
    b = m;
    m = t;
  }
  cout << a / m << " " << n / m;
  return 0;
}
