#include <bits/stdc++.h>
using namespace std;
long long s[1100000], f[1100000];
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%I64d", &s[i]);
  sort(s + 1, s + 1 + n);
  for (int i = 1; i <= n; ++i) f[i] = f[i - 1] + s[i];
  long long sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += s[i] * i - f[i - 1];
    sum += (f[n] - f[i]) - s[i] * (n - i);
  }
  cout << sum / gcd(sum, n) << " " << n / (gcd(sum, n)) << endl;
  return 0;
}
