//inlclude前用define #define _USE_MATH_DEFINES //include #include #include #include #include #include using namespace std; //typedef typedef vector VI; typedef vector VS; typedef vector VC; int main() { int n; cin >> n; VI a(n); for (int i = 0; i < n; i++) cin >> a[i]; int max_ans=abs(a[n-1]-a[0]); int minv=1000000000,div; for (int i = 0; i < n-1; i++) { div = a[i + 1] - a[i]; if (min(div, minv) == div) { minv = div; } } cout << minv << endl; cout << max_ans << endl; return 0; }