#include <bits/stdc++.h>
using namespace std;
long long n, a[200111];
long long ans1 = 1e10, ans2 = 0;
int main() {
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (long long i = 1; i < n; ++i) {
    if ((a[i] - a[i - 1]) < ans1) {
      ans1 = a[i] - a[i - 1];
      ans2 = 1;
    } else if ((a[i] - a[i - 1]) == ans1) {
      ++ans2;
    }
  }
  cout << ans1 << ' ' << ans2;
}
