#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, a[300000], minn, d;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  minn = 10000000000;
  for (int i = 0; i < n - 1; i++) {
    d = abs(a[i] - a[i + 1]);
    if (d == minn)
      k++;
    else if (d < minn) {
      minn = d;
      k = 1;
    }
  }
  cout << minn << ' ' << k;
  return 0;
}
