#include <bits/stdc++.h>
using namespace std;
const int size = 1005;
const long long modulo = 1000000009;
const int INF = 2e9;
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
int main() {
  int n;
  cin >> n;
  long long sum = 0;
  vector<long long> a(n + 1, 0);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sort(a.begin(), a.end());
  long long nom = 0;
  for (long long i = 1; i <= n; i++) {
    sum += (a[i] - a[i - 1]) * i;
    sum -= (a[i] - a[i - 1]) * (n - i + 1);
    nom += sum;
  }
  while (gcd(nom, n) > 1) {
    long long c = gcd(nom, n);
    nom /= c;
    n /= c;
  }
  cout << nom << ' ' << n << endl;
  return 0;
}
