#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int min = INT_MAX;
  map<int, int> city;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (int i = 0; i < n - 1; i++) {
    int num = arr[i + 1] - arr[i];
    city[num] += 1;
    if (min > num) {
      min = num;
    }
  }
  cout << min << " " << city[min] << '\n';
  ;
}
