#include <bits/stdc++.h>
using namespace std;
int main() {
  int min0 = (2E9 + 2);
  int a[200001];
  int n;
  int k = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n - 1; ++i) {
    if (a[i + 1] - a[i] < min0) {
      k = 0;
      min0 = a[i + 1] - a[i];
    }
    if (a[i + 1] - a[i] == min0) {
      k++;
    }
  }
  cout << min0 << " " << k;
}
