#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int mini = a[1] - a[0];
  vector<int> v;
  vector<int>::iterator it;
  v.push_back(mini);
  for (int i = 1; i < n - 1; i++) {
    if ((a[i + 1] - a[i]) <= mini) mini = a[i + 1] - a[i], v.push_back(mini);
  }
  sort(v.begin(), v.end());
  int cnt = 0, val = v[0];
  for (it = v.begin(); it != v.end(); it++) {
    if (*it == val)
      cnt++;
    else
      break;
  }
  cout << val << " " << cnt;
  return 0;
}
