#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b != 0)
    return gcd(b, a % b);
  else
    return a;
}
int main() {
  long long n;
  cin >> n;
  vector<long long> d(n);
  for (int i = 0; i < n; i++) cin >> d[i];
  sort(d.begin(), d.end());
  long long a, b;
  a = b = 0;
  for (int i = 0; i < n; i++) {
    a = a + i * d[i] - b;
    b = b + d[i];
  }
  long long K = 2 * a + b;
  long long G = gcd(K, n);
  cout << K / G << " " << n / G << endl;
}
