#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  T = 1;
  while (T--) {
    unsigned long long n;
    cin >> n;
    unsigned long long arr[n], i, md, sc = 0, lc = 0;
    for (i = 0; i < n; ++i) {
      cin >> arr[i];
    }
    sort(arr, arr + n);
    md = arr[n - 1] - arr[0];
    cout << md << " ";
    if (md == 0) {
      cout << (n * (n - 1)) / 2;
    } else {
      for (i = 0; i < n; ++i) {
        if (arr[i] == arr[0]) {
          sc++;
        }
        if (arr[i] == arr[n - 1]) {
          lc++;
        }
      }
      cout << sc * lc;
    }
  }
  return 0;
}
