#include <bits/stdc++.h>
using namespace std;
int m, n, i, j, a[200001], k;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  m = a[n] - a[1];
  for (i = 2; i <= n; i++)
    if (m > a[i] - a[i - 1]) m = a[i] - a[i - 1];
  for (i = 2; i <= n; i++)
    if (m == a[i] - a[i - 1]) k++;
  cout << m << " " << k << endl;
}
