#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[200000];
  long long b[200000], bmin = 999999999999, kmin;
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    b[i] = a[i + 1];
    b[i] -= a[i];
    if (b[i] == bmin)
      kmin++;
    else if (b[i] < bmin) {
      bmin = b[i];
      kmin = 1;
    }
  }
  cout << bmin << ' ' << kmin << endl;
}
