#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
const long long MM = 998244353;
const long double Pi = acos(-1);
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    map<long long, long long> make_pair;
    set<long long> s;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      s.insert(a[i]);
      make_pair[a[i]]++;
    }
    sort(a, a + n);
    if (a[n - 1] == a[0]) {
      long long k = (n * (n - 1)) / 2;
      cout << 0 << " " << k << endl;
      return 0;
    }
    cout << a[n - 1] - a[0] << " ";
    long long curr = 1;
    cout << curr * make_pair[a[0]] * make_pair[a[n - 1]];
  }
  return 0;
}
