Let the distance between A and B be (D) km, and the scheduled travel time be (T) hours.
Case 1: Speed = 50 km/h (1 hour early)
50D=T−1
Speed = 30 km/h (1 hour late)
30D=T+1
Subtract equations
30D−50D=(T+1)−(T−1)
30D−50D=2
Find LCM of 30 and 50 = 150:
1505D−3D=2
1502D=2
75D=2
D=150
Final Answer
150 km