#include <bits/stdc++.h>
using namespace std;
long long ss[200005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> ss[i];
  }
  sort(ss, ss + n);
  long long minn = 1e10 + 7;
  for (int i = 0; i < n - 1; i++) {
    minn = min(minn, abs(ss[i] - ss[i + 1]));
  }
  cout << minn << ' ';
  long long cntt = 0;
  for (int i = 0; i < n - 1; i++) {
    if (abs(ss[i] - ss[i + 1]) == minn) cntt++;
  }
  cout << cntt << endl;
  return 0;
}
