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