#include <bits/stdc++.h>
int main() {
  long long n, arr[200001], i, j, c = 0, c1 = 0, big, small;
  scanf("%I64d", &n);
  scanf("%I64d", &arr[0]);
  big = arr[0];
  small = arr[0];
  for (i = 1; i < n; i++) {
    scanf("%I64d", &arr[i]);
    if (big < arr[i]) big = arr[i];
    if (small > arr[i]) small = arr[i];
  }
  for (j = 0; j < n; j++) {
    if (arr[j] == big) c++;
    if (arr[j] == small) c1++;
  }
  if (big == small)
    printf("%I64d %I64d", big - small, n * (n - 1) / 2);
  else
    printf("%I64d %I64d", big - small, c * c1);
  return 0;
}
