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