#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void debug(T x) {
  cout << "x = " << x << endl;
}
template <class T1, class T2>
inline void debug(T1 x, T2 y) {
  cout << "x = " << x << ", y = " << y << endl;
}
template <class T1, class T2, class T3>
inline void debug(T1 x, T2 y, T3 z) {
  cout << "x = " << x << ", y = " << y << ", z = " << z << endl;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <class T>
inline T cube(T x) {
  return x * x * x;
}
template <class T>
inline T quad(T x) {
  return x * x * x * x;
}
template <class T>
inline T setBit(T n, T pos) {
  return n = n | (1 << pos);
}
template <class T>
inline T resetBit(T n, T pos) {
  return n = n & ~(1 << pos);
}
template <class T>
inline bool checkBit(T n, T pos) {
  return n & (1 << pos);
}
template <class T>
inline T GCD(T a, T b) {
  if (a < 0) return GCD(-a, b);
  if (b < 0) return GCD(a, -b);
  return (b == 0) ? a : GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
  if (a < 0) return LCM(-a, b);
  if (b < 0) return LCM(a, -b);
  return a * (b / GCD(a, b));
}
template <class T>
inline bool isPrime(T n) {
  if (n <= 1) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T abso(T x) {
  return x >= 0 ? x : -x;
}
template <class T>
inline T mod(T n, T m) {
  return (n % m + m) % m;
}
int main() {
  int n, x;
  while (cin >> n) {
    map<int, int> mp;
    unsigned long long mni = 2000000000 + 2000000000;
    unsigned long long mxi = 0;
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (mp.find(x) == mp.end())
        mp[x] = 1;
      else
        mp[x] = mp[x] + 1;
      if (mni > x) mni = x;
      if (mxi < x) mxi = x;
    }
    if (mxi == mni)
      cout << 0 << " " << ((unsigned long long)mp[mni] * (mp[mni] - 1)) / 2
           << endl;
    else
      cout << mxi - mni << " " << (unsigned long long)mp[mni] * mp[mxi] << endl;
  }
  return 0;
}
