#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, aux, mi, cmi;
  vector<long long> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> aux;
    v.push_back(aux);
  }
  sort(v.begin(), v.end());
  mi = 10000000000;
  cmi = 1;
  for (i = 1; i < n; i++) {
    if (v[i] - v[i - 1] == mi) {
      cmi++;
    }
    if (v[i] - v[i - 1] < mi) {
      mi = v[i] - v[i - 1];
      cmi = 1;
    }
  }
  cout << mi << " " << cmi << endl;
}
