#include <bits/stdc++.h>
using namespace std;
long long a[200005];
long long temp[200005];
int main() {
  long long n;
  while (~scanf("%lld", &n)) {
    for (long long i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
    }
    sort(a, a + n);
    long long minx = fabs(a[0] - a[1]);
    for (long long i = 0; i < n - 1; i++) {
      temp[i] = fabs(a[i] - a[i + 1]);
      minx = min(minx, temp[i]);
    }
    long long total = 0;
    for (long long i = 0; i < n - 1; i++) {
      if (temp[i] == minx) {
        total++;
      }
    }
    printf("%lld %lld\n", minx, total);
  }
}
