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