Question 815732
Think of one train as moving at the sum of their
speeds and the other train standing still.
---------------------
Now picture the moment when the leading edges 
( the engines ) of each train meet.
---------------------
Now imagine you are at the very tail end of the
moving train. You will have to travel the length
of your train until you are at the engine of the
stationary train, and then you will have to travel
the length of the stationary train also until
both tail ends meet, and the trains have passed
each other.
---------------------
You can write the equation for this as:
{{{ .12 + .08 = ( 42 + 30 )*t }}}
where units are km for distance and hrs for time
{{{ .2 = 72t }}}
{{{ t = .002778 }}} hrs
To get seconds:
{{{ .002778*360 = 1 }}} sec