#include <bits/stdc++.h>
using namespace std;
const long long INF = 21474836472147447LL;
int n;
vector<long long> a;
long long amin = INF, cnt = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    long long xx;
    scanf("%I64d", &xx);
    a.push_back(xx);
  }
  sort(a.begin(), a.end());
  for (int i = 1; i < a.size(); i++) {
    if (abs(a[i] - a[i - 1]) < amin) {
      amin = abs(a[i] - a[i - 1]);
      cnt = 1;
    } else if (abs(a[i] - a[i - 1]) == amin)
      cnt++;
  }
  printf("%I64d %I64d\n", amin, cnt);
  return 0;
}
