#include <bits/stdc++.h>
using namespace std;
const int max_n = 2 * 1e5 + 1;
long long n;
long long b[max_n];
map<long long, long long> mp;
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
    mp[b[i]]++;
  }
  if (mp.size() == 1)
    cout << 0 << " " << (n * (n - 1)) / 2;
  else {
    sort(b, b + n);
    long long diff = b[n - 1] - b[0];
    cout << diff << " ";
    cout << mp[b[0]] * mp[b[n - 1]];
  }
}
