#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
long long a[maxn];
int n;
inline long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
int main() {
  while (cin >> n) {
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    sort(a + 1, a + 1 + n);
    long long j = 1 - n;
    for (int i = 1; i <= n; i++, j += 2) {
      sum += j * a[i] * 2;
    }
    long long gcdm = gcd(sum, n);
    cout << sum / gcdm << " " << n / gcdm << endl;
  }
  return 0;
}
