#include <bits/stdc++.h>
using namespace std;
int agrav(int n) {
  long long k = 0;
  for (int i = n - 1; i >= 1; i--) {
    k += i;
  }
  return k;
}
int qanak(int n) {
  int k = 0;
  while (n != 0) {
    n /= 10;
    k++;
  }
  return k;
}
int tvan[100007];
long long tv(long long n) {
  long long sum = 0;
  long long ans = 0;
  long long tiv = 0;
  long long m = qanak(n);
  long long l = m;
  long long r = pow(10, m);
  long long k = pow(10, m - 1);
  while (l--) {
    tiv = (n % r) / k;
    r /= 10;
    k /= 10;
    sum += tiv;
  }
  return sum;
}
int a[1000001];
int main() {
  int n, m, i, j, k, l, g, d = 0, r = 0;
  string s = " ";
  int x, y;
  vector<long long> v;
  map<int, int> mp;
  set<int> ms;
  multiset<int> mms;
  g = 0;
  k = 0;
  char ch[] = {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p',
               'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';',
               'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/'};
  int b, c;
  cin >> n;
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (a[0] == a[n - 1]) {
    cout << 0 << " " << (long long)n * (n - 1) / 2 << endl;
    return 0;
  }
  int a1, a2;
  for (i = 1; i < n; i++)
    if (a[i] != a[i - 1]) break;
  a1 = i;
  for (i = n - 2; i >= 0; i--)
    if (a[i] != a[i + 1]) break;
  a2 = n - 1 - i;
  cout << a[n - 1] - a[0] << " " << (long long)a1 * a2 << endl;
  return 0;
}
