#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  t = 1;
  while (t--) {
    int n;
    cin >> n;
    vector<int> b(n);
    for (int i = 0; i < n; ++i) cin >> b[i];
    sort(b.begin(), b.end());
    auto hi = equal_range(b.begin(), b.end(), b[n - 1]);
    auto lo = equal_range(b.begin(), b.end(), b[0]);
    int h = hi.second - hi.first;
    int l = lo.second - lo.first;
    if (b[n - 1] > b[0])
      cout << (b[n - 1] - b[0]) << " " << (long long int)h * l << endl;
    else
      cout << 0 << " " << ((long long int)h * (h - 1)) / 2 << endl;
  }
  return 0;
}
