#include <bits/stdc++.h>
using namespace std;
int main() {
  int n{};
  cin >> n;
  long long int b[n];
  long long int min{}, max{};
  long long int min_count{}, max_count{};
  for (int i{}; i < n; ++i) {
    cin >> b[i];
    if (b[i] <= min || min == 0) {
      if (b[i] == min)
        ++min_count;
      else {
        min_count = 1;
        min = b[i];
      }
    }
    if (b[i] >= max) {
      if (b[i] == max)
        ++max_count;
      else {
        max_count = 1;
        max = b[i];
      }
    }
  }
  if (n == 1)
    cout << 0 << " " << 1;
  else if (max == min)
    cout << 0 << " " << (min_count * (min_count - 1)) / 2;
  else
    cout << max - min << " " << min_count * max_count;
  return 0;
}
