#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
int dblcmp(double d) {
  if (fabs(d) < eps) return 0;
  return d > eps ? 1 : -1;
}
const double PI = 3.1415926535897932384626433832795;
const double pi = acos(-1.0);
const int mod = 1000000007;
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
long long pov(long long a, long long b, long long mod) {
  long long res = 1;
  while (b > 0) {
    if (b % 2) {
      res *= a;
      b--;
    } else {
      b /= 2;
      a *= a;
      ;
    }
    res %= mod;
  }
  return res;
}
void A() {
  int x, y, u, v;
  cin >> x >> y >> u >> v;
  if (x == u) {
    cout << x + y - v << " " << y << " " << u + y - v << " " << v;
  } else if (y == v) {
    cout << x << " " << y + x - u << " " << u << " " << v + x - u;
  } else {
    if ((x - u) * (x - u) != (y - v) * (y - v)) {
      cout << -1;
    } else {
      cout << x << " " << v << " " << u << " " << y;
    }
  }
}
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  map<long long, long long> m;
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    m[t]++;
  }
  map<long long, long long>::iterator it = m.end();
  it--;
  long long diff = it->first - m.begin()->first;
  long long count = it->second * m.begin()->second;
  if (m.size() == 1) count = (m.begin()->second * (m.begin()->second - 1)) / 2;
  cout << diff << " " << count;
  return 0;
}
