#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  long long a;
  long long maxi = INT_MIN;
  long long mini = INT_MAX;
  long long maxcount = 1;
  long long mincount = 1;
  for (long long i = 0; i < n; i++) {
    cin >> a;
    if (a < mini) {
      mincount = 1;
      mini = a;
    } else if (a == mini) {
      mincount++;
    }
    if (a > maxi) {
      maxcount = 1;
      maxi = a;
    } else if (a == maxi) {
      maxcount++;
    }
  }
  cout << maxi - mini << " ";
  if (maxi == mini) {
    long long sum = 0;
    for (long long i = 1; i < maxcount; i++) {
      sum += i;
    }
    cout << sum;
  } else {
    cout << maxcount * mincount;
  }
}
