#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long power(long long x, long long n) {
  long long result = 1;
  while (n) {
    if (n & 1) {
      result = result * x % MOD;
    }
    n = n / 2;
    x = x * x % MOD;
  }
  return result;
}
string decToBinary(long long n) {
  string s = "";
  for (long long i = 31; i >= 0; i--) {
    long long k = n >> i;
    if (k & 1) {
      s += "1";
    } else {
      s += "0";
    }
  }
  return s;
}
long long dx[4] = {1, -1, 0, 0};
long long dy[4] = {0, 0, -1, 1};
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long min = a[0], max = a[n - 1];
  long long c = 0;
  cout << max - min << " ";
  if (max == min) {
    cout << n * (n - 1) / 2;
    return 0;
  }
  long long i = 0;
  while (a[i] == min) {
    i++;
  }
  long long j = n - 1;
  while (a[j] == max) {
    j--;
  }
  j = n - j - 1;
  c = i * j;
  cout << c;
}
