#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, x, y, c = 0, d = 0;
  cin >> n;
  vector<long long int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  sort(v.begin(), v.end());
  x = v[0];
  y = v[n - 1];
  for (i = 0; i < n; i++) {
    if (v[i] == x) c++;
    if (v[i] == y) d++;
  }
  cout << y - x << " ";
  if (x == y)
    cout << n * (n - 1) / 2;
  else
    cout << c * d;
}
