#include using namespace std; int main() { int N; cin >> N; vector X( N ); for( int i = 0; i < N; i++ ) { cin >> X[i]; } sort( X.begin(), X.end() ); int ans = INT32_MAX; for( int i = 1; i < N; i++ ) { int d = abs( X[i] - X[i - 1] ); if( d ) ans = min( ans, d ); } if( ans == INT32_MAX ) ans = 0; cout << ans << endl; }