gets a=gets.split.map &:to_i m=2*10**5 a.each_cons(2){|x,y|d=y-x;m=(d