$%=1e9;$N=<>; @_=sort{$a-$b}glob<>; $%-=$-=$%-($_[$_+1]-$_[$_]||$%)for 0..$N-2; print$%-1e9&&$%