Given: Time to cross a man by the train in = 5 sec
Length of a bridge = 300 m
Time to cross a bridge by the train in = 20 sec
Calculation: Let, the speed of the train = x m/s
Length of the train = y m
According to the question,
⇒ 5x = y ----(1)
According to the question,
⇒ 20x = y + 300⇒ 20x = 5x + 300 [from (1)]
⇒ 15x = 300
⇒ x = 20
⇒ Speed of the train = 20 m/s
∴ Length of the train = (5 × 20) = 100 m