#include "bits/stdc++.h" 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 m = 999999; for (int j = 0; j < x.size()-1; ++j) { if (x[j+1] - x[j] != 0) { m = min(m, x[j+1] - x[j]); } } if (m == 999999) { cout<<0<