#include <bits/stdc++.h>
using namespace std;
long long gcd(long long u, long long v) {
  if (u == v) return u;
  if (u == 0) return v;
  if (v == 0) return u;
  if (~u & 1) {
    if (v & 1)
      return gcd(u >> 1, v);
    else
      return gcd(u >> 1, v >> 1) << 1;
  }
  if (~v & 1) return gcd(u, v >> 1);
  if (u > v) return gcd((u - v) >> 1, v);
  return gcd((v - u) >> 1, u);
}
int main() {
  int n;
  scanf("%d", &n);
  vector<long long> num, prev, next;
  num.resize(n + 1);
  prev.resize(n + 2);
  next.resize(n + 2);
  num[0] = 0;
  for (int i = 1; i <= n; i++) cin >> num[i];
  sort(num.begin(), num.end());
  prev[0] = 0;
  next[n + 1] = 0;
  for (int i = 1; i <= n; i++) prev[i] = num[i] + prev[i - 1];
  for (int i = n; i > 0; i--) next[i] = next[i + 1] + num[i];
  long long ans = 0;
  for (long long i = 1; i <= n; i++) {
    ans +=
        (num[i] - (prev[i - 1]) + (next[i + 1] + (-n + (2 * i - 1)) * num[i]));
  }
  long long t = gcd(ans, n);
  cout << ans / t << " " << n / t << endl;
}
