#include <bits/stdc++.h>
using namespace std;
void ff() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
void in_out_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ff();
  int n;
  cin >> n;
  long long x;
  map<long long, long long> mp;
  for (int i = 0; i < n; i++) {
    cin >> x;
    mp[x]++;
  }
  map<long long, long long>::iterator it = mp.begin();
  x = it->first;
  long long y = -1;
  it++;
  for (; it != mp.end(); it++) y = it->first;
  if (y == -1) {
    cout << 0 << " ";
    cout << mp[x] * (mp[x] - 1) / 2 << endl;
  } else {
    long long co = 0;
    long long mx = y;
    y -= x;
    for (it = mp.begin(); it != mp.end(); it++) {
      if (y + it->first <= mx) {
        co += it->second * mp[y + it->first];
      } else
        break;
    }
    cout << y << " " << co << endl;
  }
  return 0;
}
