#include #include #include #define REP(i,a) for(i=0;i>n; vector v; int i,x; REP(i,n){ cin>>x; v.push_back(x); } sort(v.begin(),v.end()); int min=1000001; REP(i,v.size()-1){ if((v[i]!=v[i+1])&&(min>=v[i+1]-v[i])){min=v[i+1]-v[i];} } cout << (min==1000001?0:min) << endl; return 0; }