#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::max;
using std::min;
using std::pow;
using std::string;
const int N_max = 200004;
int main() {
  int n, m, k;
  int a[N_max];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  std::sort(a, a + n);
  int min_dist = 2107483647;
  int counter = 0;
  for (int i = 0; i < n - 1; ++i) {
    min_dist = min(min_dist, std::abs(a[i + 1] - a[i]));
  }
  for (int i = 0; i < n - 1; ++i) {
    if (min_dist == std::abs(a[i + 1] - a[i])) counter++;
  }
  cout << min_dist << ' ' << counter << '\n';
  return 0;
}
