dude this isnt a question on power-its pure kinematics.
I'd asked this question earlier but couldn't get the correct answer.Here goes:
Initial velocity=v...say
Pull of engine=resistance(no acc.)=KM=>K=a
When uncoupled,extra pull=KM-K(M-m)
=Km
Acc of train=Km/(M-m)
Retardation for bogey=K
Distance travelled by train=L
& L=vt+0.5(Kmt^2/(M-m))....2nd eqn of motion..(remember this relation)
=>2L/t=2v+Kmt/(M-m)
Once steam shuts off=s..say
V^2-U^2=2as
It stops,so V=0
So,U^2=2Ks
2Ks=(v+Kmt/(M-m))^2.....1st eq of motion
=>s=[(v+kmt/(M-m))^2]/2K....remember this
Distance travelled by last bogey=s2...say
s2=v^2/2k....3rd eqn of motion
Distance between them=l+s-s2
Simplify it...its slightly tricky and you'll get your answer..
Thats quite some typing..
Rate if it helped!!