#include <bits/stdc++.h>
using namespace std;
int long long gcd(int long long a, int long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int long long n;
  cin >> n;
  int long long a[n];
  int long long sum = 0;
  for (int long long i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  int long long sumb = 0, ans1 = 0;
  sort(a, a + n);
  for (int long long i = 0; i < n; i++) {
    ans1 += i * a[i] - sumb;
    sumb += a[i];
  }
  int long long ans = sum + 2 * ans1;
  cout << ans / (gcd(ans, n)) << " " << n / gcd(ans, n);
  return 0;
}
