#include <bits/stdc++.h>
using namespace std;
int main() {
  int c, n, a[200008];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int m, min;
  c = 1;
  min = abs(a[0] - a[1]);
  for (int i = 1; i < n - 1; i++) {
    m = abs(a[i] - a[i + 1]);
    if (m < min) {
      c = 1;
      min = m;
    } else if (m == min) {
      c++;
    }
  }
  cout << min << " " << c;
  return 0;
}
