#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1 << 30) #define INFLL (1LL << 60) int x[1000010]; int main() { int n; int ans = INF; cin >> n; for(int i = 0;i < n;i++){ cin >> x[i]; } for(int i = 0;i < n;i++){ for(int j = 0;j < n;j++){ if(i == j)continue; if(x[i] == x[j]) continue; ans = min(ans,abs(x[i]-x[j])); } } cout << ans << endl; return 0; }