#include #include #include #include using namespace std; int main() { int N; cin >> N; vectorvec(N); for (int ia = 0; ia < N; ia++) { cin >> vec.at(ia); } sort(vec.begin(), vec.end()); int m = 1000000000; int M = vec.at(N-1) - vec.at(0); for (int ib = 0; ib < N - 1; ib++) { m = min(m, vec.at(ib + 1) - vec.at(ib)); } cout << m << endl << M << endl; }