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