#include <bits/stdc++.h>
using namespace std;
int n, a[200005];
map<int, int> mp;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  std::sort(a, a + n);
  for (int i = 0; i < n - 1; i++) mp[abs(a[i] - a[i + 1])]++;
  cout << mp.begin()->first << " " << mp.begin()->second << '\n';
  return 0;
}
