#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
const int32_t m = 1e9 + 7;
const int32_t mm = 998244353;
void maxifier() {
  long long int n;
  cin >> n;
  vector<long long int> v(n), w;
  for (long long int i = 0; i < n; i++) {
    cin >> v[i];
  }
  w = v;
  sort(v.begin(), v.end());
  long long int min_dist = inf;
  for (long long int i = 0; i < n - 1; i++) {
    min_dist = min(min_dist, abs(v[i + 1] - v[i]));
  }
  unordered_map<long long int, long long int> make_pair;
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    if (make_pair.find(w[i] - min_dist) != make_pair.end()) {
      ans += make_pair[w[i] - min_dist];
    }
    make_pair[w[i]]++;
  }
  make_pair.clear();
  for (long long int i = 0; i < n; i++) {
    if (make_pair.find(w[i] + min_dist) != make_pair.end()) {
      ans += make_pair[w[i] + min_dist];
    }
    make_pair[w[i]]++;
  }
  cout << min_dist << " " << ans << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int tc, t = 0;
  tc = 1;
  while (tc--) {
    maxifier();
  }
  return 0;
}
