#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
int n, a[N];
int main() {
  for (; ~scanf("%d", &n);) {
    for (int i = 0; i < n; i++) scanf("%d", a + i);
    sort(a, a + n);
    long long sum = 0;
    for (int i = 0; i < n; i++) sum += 1LL * a[i] * ((4 * i + 3) - 2 * n);
    long long f = gcd(sum, n);
    cout << sum / f << " " << n / f << endl;
  }
  return 0;
}
