#include <bits/stdc++.h>
using namespace std;
void ram5564() {
  long long n;
  cin >> n;
  long long a[n];
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
  }
  sort(a, a + n);
  long long diff = a[n - 1] - a[0];
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (m[a[i] + diff] > 0) {
      m[a[i]]--;
      cnt += m[a[i] + diff];
    }
  }
  cout << diff << " " << cnt;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) ram5564();
  return 0;
}
