#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long max(long long x, long long y) {
  if (x > y)
    return x;
  else
    return y;
}
long long min(long long x, long long y) {
  if (x > y)
    return y;
  else
    return x;
}
int main() {
  long long i, j, k, l, n, m, p, q;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  j = a[n - 1] - a[0];
  i = 0;
  k = 0;
  p = 0;
  while ((a[i] == a[0])) {
    i++;
    k++;
    if (i == n) break;
  }
  i = n - 1;
  while ((a[i] == a[n - 1])) {
    i--;
    p++;
    if (i == 0) break;
  }
  if (k == n) {
    cout << j << " " << ((n * (n - 1)) / 2);
  } else
    cout << j << " " << (k * p);
  return 0;
}
