gets x=gets.split.map(&:to_i).sort.uniq n=x.size m=nil if n>1 then (0...n-1).each{|i|m=(x[i+1]-x[i]).abs if m.nil? || (x[i+1]-x[i]).abs < m} else m=0 end puts m