#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
int main() {
  int n, t;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    m[t]++;
  }
  if (m.size() == 1) {
    cout << "0 " << (1LL * n * (n - 1) / 2) << endl;
    return 0;
  }
  __typeof(m.begin()) ft = m.begin();
  __typeof(m.begin()) la = m.end();
  la--;
  cout << (la->first - ft->first) << " " << (1LL * la->second * ft->second)
       << endl;
  return 0;
}
