When two cars meet at a distance of 20km from the midpoint between Party A and Party B, the express train travels 20 * 2 = 40km more than the local train.
The time they meet is 40/(50-40)=4 hours.
The distance between Party A and Party B is 4 * (40+50) = 360km.