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