#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
void solve() {
  long long n;
  cin >> n;
  std::vector<long long> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  if (v.front() == v.back()) {
    cout << 0 << " " << n * (n - 1) / 2;
    return;
  }
  auto a = upper_bound(v.begin(), v.end(), v[0]) - v.begin();
  auto b = n - (lower_bound(v.begin(), v.end(), v[n - 1]) - v.begin());
  cout << v.back() - v.front() << " " << a * b;
}
