import std.stdio, std.string, std.conv; import std.algorithm, std.array; import core.stdc.stdlib; void main(){ auto s = readln.strip.to!int; int[] arr = readln.strip.split.map!(to!int).array; if(s == 1){0.writeln;exit(-1);} arr.sort; int ans = int.max, before = arr[0]; foreach(i, x; arr){ if(before == x) continue; if(ans > x - before){ ans = x - before; } before = x; } writeln(ans != int.max ? ans : 0); }