#include <bits/stdc++.h>
using namespace std;
set<int> S;
int main() {
  int n, a, min = INT_MAX, count = 0, i, b, c;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a;
    S.insert(a);
  }
  for (set<int>::const_iterator it = S.begin(); it != S.end(); it++) {
    c = *it;
    if (c - b < min && it != S.begin()) {
      min = c - b;
      count = 1;
    } else if (c - b == min && it != S.begin()) {
      count++;
    }
    b = *it;
  }
  cout << min << " " << count;
  return 0;
}
