#include <bits/stdc++.h>
using namespace std;
int n;
long long v[200000];
void citire() {
  string sir;
  getline(cin, sir);
  getline(cin, sir);
  int poz = 0, numar, contor = 0, caz;
  while (poz < sir.size()) {
    numar = 0;
    caz = 1;
    if (sir[poz] == '-') poz++, caz = -1;
    while (sir[poz] <= '9' && sir[poz] >= '0')
      numar = numar * 10 + sir[poz] - '0', poz++;
    v[contor] = numar * caz;
    contor++;
    poz++;
  }
}
int main() {
  cin >> n;
  citire();
  sort(v, v + n);
  long long minn = 10000000000, contor = 0;
  for (int i = 0; i < n - 1; i++) {
    if (abs(v[i] - v[i + 1]) < minn)
      minn = abs(v[i] - v[i + 1]), contor = 1;
    else if (abs(v[i] - v[i + 1]) == minn)
      contor++;
  }
  cout << minn << " " << contor;
}
