#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long m = INT_MAX;
  for (long long i = 1; i < n; i++) {
    m = min(m, abs(a[i - 1] - a[i]));
  }
  long long c = 0;
  for (long long i = 1; i < n; i++) {
    if (abs(a[i] - a[i - 1]) == m) {
      c++;
    }
  }
  cout << m << " " << c << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
