#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int md = INT_MAX;
  int count = 0;
  for (int x = 0; x < n - 1; x++) {
    if (a[x + 1] - a[x] < md) {
      md = a[x + 1] - a[x];
      count = 1;
    } else if (a[x + 1] - a[x] == md) {
      count++;
    }
  }
  cout << md << " " << count;
}
