#include <bits/stdc++.h>
std::pair<int, int> findMinDiff(std::vector<int>& nums) {
  std::sort(nums.begin(), nums.end());
  int diff = INT_MAX;
  int occur = 0;
  for (int i = 0; i < nums.size() - 1; ++i) {
    if (abs(nums[i + 1] - nums[i]) == diff) {
      ++occur;
    }
    if (std::abs(nums[i + 1] - nums[i]) < diff) {
      diff = nums[i + 1] - nums[i];
      occur = 1;
    }
  }
  return std::make_pair(diff, occur);
}
int main() {
  int n;
  std::cin >> n;
  std::vector<int> nums;
  while (n--) {
    int a;
    std::cin >> a;
    nums.push_back(a);
  }
  auto retPair = findMinDiff(nums);
  std::cout << retPair.first << " " << retPair.second << std::endl;
  return 0;
}
