#include <bits/stdc++.h>
using namespace std;
inline int rd() {
  char c = getchar();
  while (!isdigit(c)) c = getchar();
  int x = c - '0';
  while (isdigit(c = getchar())) x = x * 10 + c - '0';
  return x;
}
int n, a[100001];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void input() {
  n = rd();
  for (int i = 1, _ = n; i <= _; i++) a[i] = rd();
}
inline void ff(long long &a, long long &b) {
  long long g = gcd(a, b);
  a /= g, b /= g;
}
void solve() {
  long long up = 0;
  long long down = n;
  std::sort(a + 1, a + n + 1);
  for (int i = 1, _ = n; i <= _; i++) {
    up += a[i];
    up += 1ll * (i - 1) * a[i] * 2;
    up -= 1ll * (n - i) * a[i] * 2;
  }
  ff(up, down);
  cout << up << " " << down << endl;
}
int main() {
  input();
  solve();
  return 0;
}
