#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int main() {
  static int a[maxn], n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int dif = abs(a[2] - a[1]), cnt = 1;
  for (int i = 3; i <= n; i++) {
    int d = abs(a[i] - a[i - 1]);
    if (d == dif) {
      cnt++;
    } else if (d < dif) {
      dif = d;
      cnt = 1;
    }
  }
  cout << dif << " " << cnt << endl;
  return 0;
}
