class Yukicoder def initialize n = gets.chomp.to_i x = gets.chomp.split(' ').map(&:to_i).uniq min_value = Float::INFINITY x.each_cons(2) do |a,b| min_value = [min_value, b-a].min end puts min_value end end Yukicoder.new