#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
ll gcd(ll a, ll b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  int n;
  cin >> n;
  vector<ll> a(n);
  ll sum1 = 0, sum2 = 0, sumbefore = 0, sumtot = 0;
  for (ll &x : a) {
    cin >> x;
    sum1 += x;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    sum2 += 1ll * a[i] * i - sumbefore;
    sumbefore += a[i];
  }
  sumtot = sum1 + 2 * sum2;
  ll _gcd = gcd(sumtot, n);
  cout << sumtot / _gcd << " " << n / _gcd << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
