#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[200000] = {0}, M = 2e9;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  map<int, int> b;
  for (int i = 0; i < n - 1; i++) {
    M = min(M, abs(a[i] - a[i + 1]));
    b[abs(a[i] - a[i + 1])]++;
  }
  printf("%d %d", M, b[M]);
  return 0;
}
