#include <bits/stdc++.h>
using namespace std;
int x[200000];
long long mina = 2e9;
int main() {
  int n, cnt = 0;
  cin >> n;
  priority_queue<int, vector<int>, less<int> > a;
  for (int i = 0; i < n; i++) {
    cin >> x[i];
    a.push(x[i]);
  }
  while (a.size() - 1) {
    int m = a.top();
    a.pop();
    int n = a.top();
    if (mina > abs(m - n)) {
      mina = m - n;
      cnt = 1;
    } else if (mina == abs(m - n)) {
      cnt++;
    }
  }
  cout << mina << " " << cnt << endl;
}
