#include #include int main(){ int i, n, a, b, c = 10000000; scanf("%d", &n); if(n) scanf("%d", &a); for(i = 1; i < n; i++){ scanf("%d", &b); if(a != b && abs(a - b) < c) c = abs(a - b); a = b; } if(c == 10000000) c = 0; printf("%d\n", c); return 0; }