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