#include <bits/stdc++.h>
using namespace std;
const int N = -1;
const long long INF = 1e9 + 19;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  sort((a).begin(), (a).end());
  int x = INF * 2;
  int cnt = 0;
  for (int i = 0; i + 1 < n; i++) {
    if (a[i + 1] - a[i] < x) {
      x = a[i + 1] - a[i];
      cnt = 0;
    }
    if (a[i + 1] - a[i] == x) {
      cnt++;
    }
  }
  cout << x << " " << cnt << endl;
  return 0;
}
