#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long int> ar(n);
  for (int i = 0; i <= n - 1; i++) {
    cin >> ar[i];
  }
  sort(ar.begin(), ar.end());
  long long int mm, ma;
  mm = ma = ar[1] - ar[0];
  int cnt = 1;
  for (int i = 2; i <= n - 1; i++) {
    ma = ar[i] - ar[i - 1];
    if (ma == mm)
      cnt++;
    else if (ma < mm) {
      cnt = 1;
      mm = ma;
    }
  }
  cout << mm << " " << cnt;
  return 0;
}
