#include #include #include #include using namespace std; int main() { int n; vector a; bool flag=false; cin >> n; for (int i = 0;i < n;i++) { int buf; cin >> buf; a.push_back(buf); } for (int i = 0;i < a.size()-1;i++) { if (a[i] == a[i + 1])flag = true; } if (flag)cout << 0 << endl; else { int ans=1000000000; for (int i = 0;i < a.size()-1;i++) { int buf = abs(a[i+1]-a[i]); ans = min(ans,buf); } cout << ans << endl; } cout << abs(a[a.size() - 1] - a[0]) << endl; return 0; }