#include <bits/stdc++.h>
int dx[] = {0, 0, +1, -1};
int dy[] = {+1, -1, 0, 0};
int dxx[] = {+1, 0, -1, 0, +1, +1, -1, -1};
int dyy[] = {0, +1, 0, -1, +1, -1, +1, -1};
int Dx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
int Dy[] = {-1, -2, -2, -1, 1, 2, 2, 1};
using namespace std;
set<long long>::iterator it;
long long arr[211111];
vector<long long> v;
int main() {
  long long n, n1, n2, n3, m, m1, m2, m3, a, b, c, i, j, k, l, l1, l2, t, t1,
      t2, t3, s, s1, s2, s3, cnt = 0, cnt1, cnt2, cnt3, temp, flag, mx = 0, mn;
  string st, str;
  char ch;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  for (i = 0; i < n - 1; i++) {
    temp = abs(arr[i] - arr[i + 1]);
    v.push_back(temp);
  }
  sort(v.begin(), v.end());
  flag = v[0];
  temp = v.size();
  for (i = 0; i < temp; i++) {
    if (v[i] == flag) {
      cnt++;
    } else
      break;
  }
  cout << flag << " " << cnt << endl;
  return 0;
}
