trick, treat = gets.split.map(&:to_i) puts (1..(trick | treat)).inject(:*)