Let the distance to the top be d.
therefore the speed of the man with escalator not moving =(d1)m/min
therefore the speed of the escalator with the man at rest=(d3)m/min
when both the main and the escalator are moving, effective speed=(d3+d) m/min
=4d3 m/min
Therefore time taken when both men and escalator are moving=distancespeed=d4d3
34min=45seconds
Hence (B) is correct answer