#include //cin, cout #include //vector #include //sort,min,max,count #include //string,getline, to_string #include //abs(int) #include //swap, pair #include //deque #include //INT_MAX #include //bitset #include //sqrt, ceil. M_PI, pow, sin #include //fixed #include //setprecision 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()); X.erase(unique(X.begin(), X.end()), X.end()); if (X.size() <= 1) { cout << 0 << endl; } else { int min = INT_MAX; int temp; for (unsigned int i = 0; i < X.size() - 1; i++) { temp = X[i + 1] - X[i]; if (temp < min) { min = temp; } } cout << min << endl; } return 0; }