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