#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int32_t* a = new int32_t[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  std::sort(a, a + n);
  int32_t distance = a[1] - a[0];
  uint32_t count = 1;
  for (int i = 2; i < n; i++) {
    int c = a[i] - a[i - 1];
    if (c < distance) {
      distance = c;
      count = 1;
    } else if (c == distance)
      count++;
  }
  cout << distance << " " << count << endl;
  delete[] a;
}
