#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, a[N];
long long ans1 = 0x3f3f3f3f3f3f3f3f;
int ans2 = 0;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    if (ans1 > abs(a[i] - a[i + 1])) ans1 = abs(a[i] - a[i + 1]), ans2 = 0;
    if (ans1 == abs(a[i] - a[i + 1])) ans2++;
  }
  cout << ans1 << ' ' << ans2 << endl;
  return 0;
}
