#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, min, max, l = 0, m = 0, ways;
  cin >> n;
  int a[n + 1];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  min = *min_element(a, a + n);
  max = *max_element(a, a + n);
  for (i = 0; i < n; i++) {
    if (a[i] == min)
      l++;
    else
      break;
  }
  for (i = n - 1; i >= 0; i--) {
    if (a[i] == max)
      m++;
    else
      break;
  }
  if (min == max) {
    if (n % 2 == 0)
      ways = (n - 1) * (n / 2);
    else
      ways = ((n - 1) / 2) * n;
  } else
    ways = l * m;
  cout << max - min << " ";
  cout << ways;
  return 0;
}
