#include <bits/stdc++.h>
using namespace std;
long long GCD(long long a, long long b) {
  while (b ^= a ^= b ^= a %= b)
    ;
  return a;
}
int main() {
  int n;
  cin >> n;
  int arr[n + 1];
  arr[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
  }
  sort(arr, arr + n + 1);
  long long num = n * 1LL * arr[1], den;
  for (int i = 2; i <= n; i++) {
    num += (arr[i] - arr[i - 1]) * 1LL * ((2 * i - 1) * 1LL * (n + 1 - i));
  }
  long long x = GCD(num, n);
  cout << num / x << " " << n / x << endl;
}
