Let the speed of the car which started from the
place A = x kmph
and B = y kmph
Distance travelled by first car in 5h = 5x and in 1h = x
The distance covered by second car in 5h = 5y and in 1h = y
By problem when travelled in same direction,
5x – 5y = 100 ⇒ x – y = 20 …… (1)
and when travelled towards each other
x + y = 100 ……. (2)
Solving (1) and (2),
∴ x = \(\frac{120}{2}\) = 60
Substituting x = 60 in equation (1) we get
60 – y = 20
⇒ y = 60 – 20 = 40 kmph
Thus the speed of the cars are 60 kmph and 40 kmph.