#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long a[n];
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int count = 0;
  long min = 2e9;
  for (i = 0; i < n - 1; i++) {
    if (a[i + 1] - a[i] < min) {
      min = a[i + 1] - a[i];
      count = 1;
    } else if (a[i + 1] - a[i] == min) {
      count++;
    }
  }
  cout << min << " " << count;
  return 0;
}
