#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long n;
  cin >> n;
  long long arr[n + 2];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  sort(arr, arr + n);
  long long arr2[n + 2];
  arr2[0] = 0;
  for (long long i = 1; i <= n; i++) arr2[i] = arr2[i - 1] + arr[i - 1];
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    ans += (i * arr[i] - arr2[i]) * 2 + arr[i];
  }
  long long dem = 1;
  long long GCD = gcd(ans, n);
  long long num2 = n / GCD;
  ans /= GCD;
  dem *= num2;
  cout << ans << " " << dem;
  return 0;
}
