#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long n, a[N], sum = 0, pre = 0;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    sum += 2LL * (a[i] * i - pre) + a[i];
    pre += a[i];
  }
  long long g = gcd(n, sum);
  cout << sum / g << " " << n / g << endl;
  return 0;
}
