#include <bits/stdc++.h>
using namespace std;
const int MAXN = int(1e5);
int n;
long long a[MAXN];
long long sum = 0;
long long gcd(long long a, long long b) {
  return (b == 0) ? (a) : gcd(b, a % b);
}
int main() {
  cin >> n;
  for (int i = 0; i < int(n); ++i) {
    int tmp;
    scanf("%d", &tmp);
    a[i] = tmp;
    sum += a[i];
  }
  sort(a, a + n);
  long long cur = 0;
  for (int i = 0; i < int(n); ++i) {
    sum += 2ll * ((long long)i * a[i] - cur);
    cur += a[i];
  }
  long long _gcd = gcd(sum, n);
  sum /= _gcd, n /= _gcd;
  cout << sum << ' ' << n << '\n';
  return 0;
}
