#include <bits/stdc++.h>
using namespace std;
long long int factorial(int n) {
  long long int product = 1;
  for (int i = n; i > 1; i--) {
    product *= i;
  }
  return product;
}
long long int comb(int n, int r) {
  long long int nr = 1;
  int upperlimit = n - r;
  while (n > upperlimit) {
    nr *= n;
    n--;
  }
  long long int dr = factorial(r);
  return nr / dr;
}
int main() {
  int n, ip;
  cin >> n;
  vector<int> flowers;
  for (int i = 0; i < n; i++) {
    cin >> ip;
    flowers.push_back(ip);
  }
  set<int> uniq(flowers.begin(), flowers.end());
  if (uniq.size() == 1) {
    long long int combinations = comb(n, 2);
    cout << 0 << " " << combinations << endl;
    return 0;
  }
  sort(flowers.begin(), flowers.end(), greater<int>());
  int max = *max_element(flowers.begin(), flowers.end());
  int min = *min_element(flowers.begin(), flowers.end());
  int nummin = count(flowers.begin(), flowers.end(), min);
  int nummax = count(flowers.begin(), flowers.end(), max);
  cout << max - min << " " << comb(nummax, 1) * comb(nummin, 1);
  return 0;
}
