A train, x meters long, traveling at a constant speed, takes 20 seconds from the time if first enters a tunnel 300 meters long until the time it completely emerges from the tunnel. One of the stationary ceiling lights in the tunnel is directly above the train for 10 seconds. Find X.

I would really appreciate it if someone could give me a step by step explanation.

Thanks

Vicky.