# Command-line params cannot be passed in in ideone,
# so I use the variable $x to simpulate the $* variable
# which normally contains an array of string representing the params:
$x = ["This 1 is22a 3352sentence 50", "3"]
a,b=$x
p a.gsub(/\d+/){|s|s.to_i*b.to_i}