#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long a[N];
int main() {
  ios::sync_with_stdio(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  cout << a[n - 1] - a[0] << " ";
  long long f_cnt = 0, s_cnt = 0;
  for (long long i = 0; i < n; i++) {
    if (a[i] == a[0])
      f_cnt++;
    else if (a[i] == a[n - 1])
      s_cnt++;
  }
  if (f_cnt == n)
    cout << n * (n - 1) / 2;
  else
    cout << f_cnt * s_cnt << "\n";
  return 0;
}
