#include <bits/stdc++.h>
using namespace std;
long long int N, MAX = INT_MIN, MIN = INT_MAX, sayi, a, b, f;
void read() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> f;
    if (f > MAX)
      MAX = f, a = 1;
    else if (f == MAX)
      a++;
    if (f < MIN)
      MIN = f, b = 1;
    else if (f == MIN)
      b++;
  }
}
int main() {
  read();
  sayi = a * b;
  cout << MAX - MIN << ' ';
  if (MAX == MIN)
    cout << (a * (a - 1)) / 2 << endl;
  else
    cout << sayi << endl;
  return 0;
}
