#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int i, n;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long min_diff = 1e14;
  for (i = 0; i < n - 1; i++) {
    if (a[i + 1] - a[i] < min_diff) min_diff = a[i + 1] - a[i];
  }
  cout << min_diff << " ";
  int cnt = 0;
  for (i = 0; i < n - 1; i++) {
    if (a[i + 1] - a[i] == min_diff) cnt++;
  }
  cout << cnt;
  return 0;
}
