#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, p, q, a[1000001], minn, ans;
int main() {
  cin >> n;
  minn = 2000000000;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  for (i = 2; i <= n; i++) {
    if (minn > a[i] - a[i - 1]) {
      minn = a[i] - a[i - 1];
      ans = 1;
      continue;
    }
    if (minn == a[i] - a[i - 1]) ans++;
  }
  cout << minn << " " << ans;
}
