#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200010;
int a[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  int mindist = 2000000010, num;
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    int dist = a[i + 1] - a[i];
    if (dist < mindist) {
      mindist = dist;
      num = 1;
    } else if (dist == mindist) {
      num++;
    }
  }
  printf("%d %d\n", mindist, num);
  return 0;
}
