#include #include #include #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 min = 10000000; for (int i = 0; i < n-1; i++) { int diff = X[i + 1] - X[i]; if (diff > 0) { if (min > diff) { min = diff; } } } if (min == 10000000) { min = 0; } cout << min << endl; return 0; }