#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
long long a[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long mn = a[1] - a[0];
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] - a[i - 1] < mn) {
      cnt = 1;
      mn = a[i] - a[i - 1];
    } else if (a[i] - a[i - 1] == mn)
      cnt++;
  }
  cout << mn << " " << cnt;
  return 0;
}
