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