#include <bits/stdc++.h>
using namespace std;
int x = 2 * 1e9 + 2, y;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    if (abs(a[i] - a[i + 1]) < x) {
      x = abs(a[i] - a[i + 1]);
      y = 1;
    } else if (abs(a[i] - a[i + 1]) == x)
      y++;
  }
  cout << x << ' ' << y;
}
