#include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int n, min1 = 1000000; cin >> n; vector v(n); for (int i = 0; i < n; i++) cin >> v[i]; for (int i = 0; i < n - 1; i++){ if(v[i] != v[i+1])min1 = min(min1, abs(v[i+1] -v[i])); } cout << min1 << endl; }