#include <bits/stdc++.h>
using namespace std;
long long q[200002], x[200002], n, h, p, i, max1;
int main() {
  cin >> n;
  for (int i = 0; i <= n - 1; i++) cin >> x[i];
  sort(x, x + n);
  max1 = x[n - 1] - x[0];
  h = -1;
  while (i <= n - 1) {
    p = 1;
    while (x[i] == x[i + 1]) {
      i++;
      p++;
    }
    h++;
    q[h] = p;
    i++;
  }
  if (h == 0) {
    cout << max1 << " " << (n * (n - 1)) / 2 << endl;
    return 0;
  } else
    cout << max1 << " " << q[0] * q[h] << endl;
  return 0;
}
