#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int INF = 2000000007;
int main() {
  int n, x;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    a[i] = x;
  }
  sort(a.begin(), a.end());
  int pars = 0, min = INF;
  for (int i = 1; i < n; i++) {
    if (a[i] - a[i - 1] < min) {
      min = a[i] - a[i - 1];
      pars = 1;
    } else if ((a[i] - a[i - 1] == min)) {
      pars++;
    }
  }
  cout << min << " " << pars;
  return 0;
}
