#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  long long int ar[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  sort(ar, ar + n);
  long long int mi = count(ar, ar + n, ar[0]);
  long long int ma = count(ar, ar + n, ar[n - 1]);
  long long int ans;
  if (ar[0] == ar[n - 1]) {
    mi--;
    ans = ((mi) * (mi + 1)) / 2;
    cout << ar[n - 1] - ar[0] << " " << ans << endl;
  } else {
    ans = mi * ma;
    cout << ar[n - 1] - ar[0] << " " << ans << endl;
  }
  return 0;
}
