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