gets;a=gets.split.map(&:to_i) s=a.inject(:+) p a.inject(0){|t,e|t+(e*10>s ? 10 : 0)}