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