#include using namespace std; using ll = long long; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> N; vector A(N); FOR(i, 0, N){ cin >> A.at(i); } sort(ALL(A)); ll ma = A.back() - A[0]; ll mi = inf; FOR(i, 0, N-1){ ll diff = A[i+1]-A[i]; chmin(mi, diff); } p(mi); p(ma); return 0; }