#include <bits/stdc++.h>
using namespace std;
int a[200010];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int Max = 4e9;
  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (a[i] - a[i - 1] == Max) ans++;
    if (a[i] - a[i - 1] < Max) {
      Max = a[i] - a[i - 1];
      ans = 1;
    }
  }
  cout << Max << " " << ans << endl;
  return 0;
}
