#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<long long> a(n);
  long long ans = 0x3f3f3f3f3f3f3f3fll, qtd;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  for (int i = 0; i < n - 1; i++) {
    long long aux = a[i + 1] - a[i];
    if (ans > aux)
      ans = aux, qtd = 1;
    else if (ans == aux)
      qtd++;
  }
  cout << ans << " " << qtd << endl;
  return 0;
}
