#include <bits/stdc++.h>
using namespace std;
int a[1000001];
vector<int> v;
int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = x;
  }
  sort(a, a + n);
  int min = abs(a[0] - a[1]);
  for (int i = 1; i < n; i++) {
    v.push_back(abs(a[i] - a[i - 1]));
    if (abs(a[i] - a[i - 1]) < min) {
      min = abs(a[i] - a[i - 1]);
    }
  }
  for (int j = 0; j < v.size(); j++) {
    if (min == v[j]) ans++;
  }
  cout << min << " " << ans << endl;
  return 0;
}
