To make it simpler, imagine that there are 60 statements.
The old computer can manage 60 statements in 30 hours, which is 60/30=2 statements in an hour.
The new computer can manage 60 statements in 20 hours, which is 60/20=3 statements in an hour.
Together they can manage 2+3=5 statements in an hour. So it would take 60/5=12 hours.