#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> nums;
  nums.assign(n, 0);
  for (int i = 0; i < n; i++) {
    scanf("%d", &nums[i]);
  }
  sort(nums.begin(), nums.end());
  int minimum = 0;
  int pairs = 0;
  for (int i = 0; i < n - 1; i++) {
    int num1 = nums[i];
    for (int j = i + 1; j < n; j++) {
      int num2 = nums[j];
      if (num2 - num1 == minimum) {
        pairs++;
      } else if (num2 - num1 < minimum || minimum == 0) {
        minimum = num2 - num1;
        pairs = 1;
      } else {
        break;
      }
    }
  }
  printf("%d %d", minimum, pairs);
  return 0;
}
