#include <bits/stdc++.h>
using namespace std;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
long long a[100050];
int main() {
  int n;
  long long up = 0, sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%I64d", &a[i]);
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    sum += a[i];
    up += (n - i - 1) * (a[n - i - 1] - a[i]);
  }
  up *= 2;
  up += sum;
  printf("%I64d %I64d\n", up / gcd(up, n), n / gcd(up, n));
  return 0;
}
