#include <bits/stdc++.h>
using namespace std;
int a[200010];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
  }
  sort(a, a + n);
  int mn = 2e9 + 100;
  for (int i = 0; i < n - 1; ++i) {
    mn = min(mn, a[i + 1] - a[i]);
  }
  int cnt = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (a[i + 1] - a[i] == mn) {
      ++cnt;
    }
  }
  printf("%d %d", mn, cnt);
}
