#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> v;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  long long naj = 1000000000000;
  int kolku = 0;
  for (int i = 0; i < n - 1; i++) {
    int dist = v[i + 1] - v[i];
    if (dist < naj) {
      naj = dist;
      kolku = 1;
    } else if (dist == naj)
      kolku++;
  }
  cout << naj << " " << kolku << endl;
  return 0;
}
