gets c=gets.split.map(&:to_i) puts c.zip([*?1..?9]).reverse.sum("") {_2*_1}