#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //#include int main() { int n; cin >> n; int a = -9999999; int b = 99999999; vectorz; for (int i = 0; i < n; i++) { int x; cin >> x; a = max(a, x); b = min(b, x); z.push_back(x); } int t = 9999999; sort(z.begin(), z.end()); for (int i = 0; i < n - 1; i++) { t = min(t, z[i + 1] - z[i]); } cout << t << endl; cout << a - b << endl; return 0; }