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