#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, temp, i, j;
  scanf("%lld", &n);
  vector<long long int> v;
  for (i = 0; i < n; i++) {
    scanf("%lld", &temp);
    v.push_back(temp);
  }
  long long int min = 10000000000;
  sort(v.begin(), v.end());
  for (i = 0; i < n - 1; i++) {
    if (v[i + 1] - v[i] < min) min = v[i + 1] - v[i];
  }
  int count = 0;
  for (i = 0; i < n - 1; i++) {
    if (v[i + 1] - v[i] == min) count++;
  }
  printf("%lld %d", min, count);
  return 0;
}
