#include <bits/stdc++.h>
using namespace std;
int main() {
  queue<int> second;
  vector<int> v;
  int n, k = INT_MAX, c = 0;
  map<int, int> m;
  pair<int, int> p;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int second;
    cin >> second;
    v.push_back(second);
  }
  sort(v.begin(), v.end());
  k = abs(v[0] - v[1]);
  for (int i = 1; i < n; i++) {
    k = min(k, abs(v[i] - v[i - 1]));
  }
  for (int i = 1; i < n; i++) {
    if (abs(v[i] - v[i - 1]) == k) c++;
  }
  cout << k << ' ' << c;
}
