gets x = gets.split.map(&:to_i).uniq.sort puts x.each_cons(2).map { |xi, xj| (xi - xj).abs }.min