#include <bits/stdc++.h>
using namespace std;
long long vis[1111][1111] = {0};
int main() {
  long long n;
  cin >> n;
  vector<long long> v;
  for (long long i = 0; i < n; i++) {
    long long first;
    cin >> first;
    v.push_back(first);
  }
  sort(v.begin(), v.end());
  long long mini = 1e10, count1 = 0;
  for (long long i = 1; i < n; i++)
    if (abs(v[i] - v[i - 1]) < mini)
      mini = abs(v[i] - v[i - 1]), count1 = 1;
    else if (abs(v[i] - v[i - 1]) == mini)
      count1++;
  cout << mini << " " << count1;
  return 0;
}
