#include #include #include #include #include #include #include using namespace std; int main() { int N; cin >> N; vector X(N); for (int i=0; i> X[i]; } X.erase(unique(X.begin(), X.end()), X.end()); if ((int)X.size() <= 1) { cout << 0 << endl; } else { sort(X.begin(), X.end()); int ret = INT_MAX; for (int i=1; i<(int)X.size(); ++i) { ret = min(ret, abs(X[i] - X[i-1])); } cout << ret << endl; } return 0; }