#include <bits/stdc++.h>
using namespace std;
int a[200005];
int main() {
  int n;
  while (cin >> n) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    sort(a, a + n);
    int mi = a[1] - a[0];
    int num = 1;
    ;
    for (int i = 1; i < n - 1; i++) {
      if (mi > a[i + 1] - a[i]) {
        mi = a[i + 1] - a[i];
        num = 1;
      } else if (mi == a[i + 1] - a[i])
        num++;
    }
    printf("%d %d\n", mi, num);
  }
}
