#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long int n, array[200000];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> array[i];
  sort(array, array + n);
  long long int minim = 100000000000, number = 0;
  for (int i = 1; i < n; i++) {
    if (array[i] - array[i - 1] < minim) {
      minim = array[i] - array[i - 1];
      number = 1;
    } else if (array[i] - array[i - 1] == minim) {
      number++;
    }
  }
  cout << minim << " " << number << "\n";
}
