#include #include #include using namespace std; int main() { int n, min_distance = 10000000; cin >> n; int x[n]; for (int i = 0; i < n; i++) { cin >> x[i]; } sort(x, x + n); if (x[0] == x[n]) { min_distance = 0; } else { for (int i = 0; i < n - 1; i++) { if (min_distance > abs(x[i] - x[i + 1]) && x[i] != x[i + 1]) { min_distance = abs(x[i] - x[i + 1]); } } } cout << min_distance << endl; return 0; }