n = gets.to_i cheby = gets.strip.split(' ').map(&:to_i) #p @cheby goal = gets.strip.split(' ').map(&:to_i).map(&:abs) #p @goal if goal == [0, 0] puts "0" exit end goal_max = goal.max cheby_max = cheby.max if cheby.include?(goal_max) puts "1" exit end if goal_max < cheby_max puts (goal.max.to_f / cheby.max).ceil + 1 else puts (goal.max.to_f / cheby.max).ceil end