#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, a[maxn];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int ans = 2e9 + 10, num = 1;
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n; i++) {
    int dis = a[i + 1] - a[i];
    if (dis > ans) continue;
    if (dis == ans)
      num++;
    else
      ans = dis, num = 1;
  }
  cout << ans << " " << num;
  return 0;
}
