#include using namespace std; const int inf = INT_MAX; int main(){ int n; cin >> n; vector a(n); for(int a_i = 0; a_i < n; a_i++){ cin >> a[a_i]; } sort(a.begin(), a.end()); int smallest = inf; for (int i = 0; i < n-1; i++) { int temp = abs(a[i]-a[i+1]); if (smallest > temp) smallest = temp; } cout << smallest << endl; // your code goes here return 0; }