#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("-Ofast")
#pragma GCC optimize("trapv")
long long power(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
long long powm(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long lar = max(a, b);
  long long small = min(a, b);
  for (long long i = lar;; i += lar) {
    if (i % small == 0) {
      return i;
    }
  }
}
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbydec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
void dex(int a) {
  if (a == 1) {
    cout << "YES";
  }
  if (a == 2) {
    cout << "NO";
  }
  if (a == 3) {
    cout << "Yes";
  }
  if (a == 4) {
    cout << "No";
  }
}
void line(long long x) {
  for (long long i = 1; i <= x; i++) {
    cout << "-";
  }
  cout << '\n';
}
bool overflow(long double a, long double b) { return a * b > 1e18 + 10; }
long long mul(long long a, long long b, long long mod) {
  return ((a * 1LL * b) + mod) % mod;
}
long long modmul(long long a, long long b, long long mod) {
  long long res = 0;
  a %= mod;
  while (b) {
    if (b & 1) res = (res + a) % mod;
    a = (2 * a) % mod;
    b >>= 1;
  }
  return res;
}
long long sum(long long a, long long b, long long mod) { return (a + b) % mod; }
const long long N = (long long)(1e5 + 1);
const long long MOD = (long long)(1e9 + 7);
const long long INF = (long long)(2e18);
void solve(long long tc) {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  map<long long, long long> m;
  for (long long i = 1; i <= n - 1; i++) {
    m[abs(a[i] - a[i + 1])]++;
  }
  for (auto &it : m) {
    cout << it.first << " " << it.second;
    break;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long cnt = 1;
  long long t = 1;
  while (t--) {
    for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);
         blockTime.second;
         fprintf(stderr, "%s: %lld ms\n", "solve",
                 chrono::duration_cast<chrono::milliseconds>(
                     chrono::high_resolution_clock::now() - blockTime.first)
                     .count()),
              fflush(stderr), blockTime.second = false) {
      solve(cnt);
    }
    cnt++;
  }
  return 0;
}
