#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
const double eps = 1e-8;
int n;
int a[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  int dis = 2e9 + 10;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] - a[i - 1] < dis) {
      ans = 1;
      dis = a[i] - a[i - 1];
    } else if (a[i] - a[i - 1] == dis) {
      ans++;
    }
  }
  printf("%d %d\n", dis, ans);
  return 0;
}
