Let the speed of car which starts from A be x and from B be y
Therefore,speed of car from A in 5 hours = 5 x
speed of car from B in 5 hours = 5 y
Case 1
Both the cars travel in the same direction,
Therefore, 5 x - 5 y = 100
5 (x - y) = 100
Thus , x -y = 100/5= 20
Also, x = 20 + y . . . . . . . . (1)
Case 2
Both the cars travel towards each other,
Therefore, x + y = 100
From (1) , {20 + y} + y = 100
20 + 2 y = 100
2 y = 100 - 20
2 y = 80
Thus, y = 80/2 = 40 Km/hr
Substituting y = 40 in (1),
x = 20 + y
= 20 + 40
= 60 Km/hr
Thus, the speed of car which starts from A is 60 Km/hr and that of the car which starts from B is 40 Km/hr