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