#include using namespace std; 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 = 0x7fffffff; for (int i = 0; i < n-1; ++i) { int absolute = a[i] < a[i+1] ? a[i+1] - a[i] : a[i] - a[i+1]; if (absolute < smallest) { smallest = absolute; } } cout << smallest; return 0; }