#include <bits/stdc++.h>
using namespace std;
int a[100000];
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  int n;
  long long sum1 = 0, sum2 = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    sum1 += a[i];
  }
  sort(a, a + n);
  int left = 0, right = n - 1;
  while (right - left + 1 > 3) {
    sum2 += (long long)(right - left) * abs(a[right] - a[left]);
    ++left;
    --right;
  }
  if (right - left + 1 == 2)
    sum2 += abs(a[right] - a[left]);
  else if (right - left + 1 == 3)
    sum2 += 2 * abs(a[right] - a[left]);
  long long d = gcd(sum1 + 2 * sum2, n);
  cout << (sum1 + 2 * sum2) / d << " " << n / d;
  return 0;
}
