#include using namespace std; int main(){ int n,x,m=INT_MAX; cin >> n; vector a(n); for(int i = 0; i < n; i++) { cin >> x; // if(x<0) // x=x*(-1); a[i]=x; } sort (a.begin(), a.end()); for(int i = 0; i < n-1; i++) { x=a[i]-a[i+1]; if(x<0) x=x*-1; if(m>x) m=x; } cout << m; // your code goes here return 0; }