#include <bits/stdc++.h>
using namespace std;
const int INF = (long long)(1 << 31) - 1;
const int M = 1e9 + 7;
vector<bool> used;
vector<int> lbuf, rbuf;
vector<pair<int, int>> plbuf, prbuf;
vector<pair<vector<int>, vector<pair<int, int>>>> g;
vector<long long> ans;
vector<long long> f;
struct point {
  double x;
  double y;
  point(double x1, double y1) {
    x = x1;
    y = y1;
  }
  point() {}
  bool operator==(point b) { return x == b.x && y == b.y; }
};
double range(point p1, point p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
bool comp(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.first - p1.second >= p2.first - p2.second;
}
long long min(long long a, long long b, long long c) {
  return min(min(a, b), c);
}
long long max(long long a, long long b, long long c) {
  return max(max(a, b), c);
}
long long pow(long long a, long long b) {
  if (b % 2 == 0) {
    long long x = pow(a, b / 2);
    return x * x;
  } else
    return pow(a, b - 1) * a;
}
long long fakt(long long a) {
  if (f.size() - 1 >= a) {
    return f[a];
  }
  long long x = fakt(a - 1) * a;
  f.push_back(x);
  return x;
}
long long dfs(int n, int a, int b) { return 1; }
double max(double a, double b) {
  if (b >= a)
    return b;
  else
    return a;
}
void merge_sort(vector<long long> &v, long long left, long long right) {
  if (right - left <= 1) return;
  long long mid = (left + right) / 2;
  merge_sort(v, left, mid);
  merge_sort(v, mid, right);
  lbuf.assign(v.begin() + left, v.begin() + mid);
  rbuf.assign(v.begin() + mid, v.begin() + right);
  rbuf.push_back(INF);
  lbuf.push_back(INF);
  long long rp = 0, lp = 0;
  for (int i = left; i < right; ++i) {
    if (lbuf[lp] <= rbuf[rp]) {
      v[i] = lbuf[lp];
      ++lp;
    } else {
      v[i] = rbuf[rp];
      ++rp;
    }
  }
}
void merge_sort(vector<pair<int, int>> &v, long long left, long long right) {
  if (right - left <= 1) return;
  long long mid = (left + right) / 2;
  merge_sort(v, left, mid);
  merge_sort(v, mid, right);
  plbuf.assign(v.begin() + left, v.begin() + mid);
  prbuf.assign(v.begin() + mid, v.begin() + right);
  prbuf.push_back({INF, 0});
  plbuf.push_back({INF, 0});
  long long rp = 0, lp = 0;
  for (int i = left; i < right; ++i) {
    if (plbuf[lp].first - plbuf[lp].second <=
        prbuf[rp].first - prbuf[rp].second) {
      v[i] = plbuf[lp];
      ++lp;
    } else {
      v[i] = prbuf[rp];
      ++rp;
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  merge_sort(v, 0, n);
  long long min = INF, count = 0;
  for (int i = 0; i < n - 1; ++i) {
    if (abs(v[i] - v[i + 1]) < min) {
      count = 1;
      min = abs(v[i] - v[i + 1]);
    } else if (abs(v[i] - v[i + 1]) == min) {
      ++count;
    }
  }
  cout << min << " " << count;
  return 0;
}
