#include <bits/stdc++.h>
using namespace std;
int main() {
  map<long long, long long> m;
  long long n, a, maxi, mini;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    m[a]++;
  }
  map<long long, long long>::iterator i = m.begin();
  mini = i->first;
  i = m.end();
  --i;
  maxi = i->first;
  cout << maxi - mini << " ";
  if (maxi == mini)
    cout << m[maxi] * (m[maxi] - 1) / 2;
  else
    cout << m[maxi] * m[mini];
}
