#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int a[MAXN];
long long int get_gcd(long long int a, long long int b) {
  long long int j;
  if (a < b)
    j = a;
  else
    j = b;
  for (long long int i = j; i >= 1; i--) {
    if (a % i == 0 && b % i == 0) return i;
  }
}
int main() {
  long long int n;
  long long int ans1 = 0, ans2 = 0, ans = 0, pre = 0;
  scanf("%I64d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    ans2 += a[i];
  }
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    ans1 += (long long int)a[i] * (i - 1) - pre;
    pre += a[i];
  }
  ans = (long long int)2 * ans1 + ans2;
  if (ans % n == 0) {
    printf("%I64d %d", ans / n, 1);
  } else {
    long long int gcd = get_gcd(ans, n);
    printf("%I64d %I64d", ans / gcd, n / gcd);
  }
}
