#include <bits/stdc++.h>
using std::cin;
using std::cout;
using std::sort;
const int max_n = (int)2e+5;
const int infinity = 2100000000;
int n, a[max_n + 1], dist;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int min_dist = infinity;
  int answer = 1;
  for (int i = 1; i < n; i++) {
    dist = a[i] - a[i - 1];
    if (dist < min_dist) {
      min_dist = dist;
      answer = 1;
    } else if (dist == min_dist)
      answer++;
  }
  cout << min_dist << ' ' << answer;
  return 0;
}
