Begin36. The speed of the first car is \(V_1\) km/h, the second - \(V_2\) km/h, the distance between them is \(S\) km. Determine the distance between them in \(T\) hours if the cars are moving away from each other. This distance is equal to the sum of the initial distance and the total path of the cars; Common path = time * total speed.

Solution in Python 3:

import random

V1,V2 = [random.randrange(50,70) for i in range(2)]
S = random.randrange(0,20)
T = random.randrange(1,6)
total_speed = V1 + V2
total_path = total_speed * T
D = S + total_path

print("1st vehicle speed:",V1)
print("2nd vehicle speed:",V2)
print("Time:",T)
print("Total speed:",total_speed)
print("Initial Distance between vehicles:",S)
print("Final Distance between vehicles:",D)