#include <bits/stdc++.h>
using namespace std;
const int max_n = 2e5 + 5;
int b[max_n];
int main() {
  int n;
  scanf("%d", &n);
  int mi = 1e9 + 1, mx = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &b[i]);
    mi = min(mi, b[i]);
    mx = max(mx, b[i]);
  }
  if (mi == mx) {
    printf("0 %lld\n", 1LL * n * (n - 1) / 2);
    exit(0);
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n; i++) {
    if (b[i] == mi)
      cnt1++;
    else if (b[i] == mx)
      cnt2++;
  }
  printf("%d %lld\n", mx - mi, 1LL * cnt1 * cnt2);
  return 0;
}
