#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  long long int A[n];
  for (long long int i = 0; i < n; i++) {
    cin >> A[i];
  }
  long long int mini = *min_element(A, A + n);
  long long int maxi = *max_element(A, A + n);
  cout << maxi - mini << " ";
  long long int count1 = count(A, A + n, mini);
  long long int count2 = count(A, A + n, maxi);
  if (mini != maxi)
    cout << count1 * count2;
  else {
    cout << (n * (n - 1)) / 2;
  }
  return 0;
}
