#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
const int N = 1000005;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n + 1];
  map<int, int> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (int i = 0; i < n - 1; i++) {
    int x = a[i + 1] - a[i];
    int p = upper_bound(a, a + n, a[i + 1]) - a;
    m[x] += p - i - 1;
  }
  map<int, int>::iterator it = m.begin();
  cout << (*it).first << " " << (*it).second;
  return 0;
}
