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; foreach(i, x; arr){ if(i == 0) continue; if(ans > arr[i] - before){ ans = arr[i] - before; } before = arr[i]; } writeln(ans != 0 ? ans : 1); }