#include <bits/stdc++.h>
using namespace std;
int N;
long long gcd(long long x, long long y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
long long a, b, c;
vector<int> arr;
inline void ReadInput(void) {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int x;
    scanf("%d", &x);
    arr.push_back(x);
    a += x;
  }
}
inline void solve(void) {
  sort(arr.begin(), arr.end());
  long long sums = arr[0];
  for (int i = 1; i < arr.size(); i++) {
    a += ((i * 1LL * arr[i]) - sums) * 2LL;
    sums += arr[i];
  }
  b = N;
  c = gcd(a, b);
  a /= c;
  b /= c;
  cout << a << " " << b << endl;
}
inline void Refresh(void) {}
int main() {
  ReadInput();
  solve();
  return 0;
}
