public void solve() throws IOException {
    int size = nextInt();
    int[] locs = new int[size];
    for (int x = 0; x < size; x++)
      locs[x] = nextInt();

    long sum = 0;
    for (int x = 0; x < size - 1; x++)
      for (int y = x + 1; y < size; y++)
        sum += 2 * Math.abs(locs[x] - locs[y]);
    for (int x = 0; x < size; x++)
      sum += locs[x];

    int gcd = Integer.valueOf(new BigInteger(String.valueOf(sum)).gcd(
        new BigInteger(String.valueOf(size))).toString());

    sum /= gcd;

    out.println(sum + " " + size / gcd);
  }