Put everything into a table of data.
RT=D is the travel rates rule relating R rate, T time, and D distance.
RATE TIME DISTANCE
A to B s 50
B to C r t 40
TOTAL
Some cell values are not yet known but are filled using variables as shown in the table.
Time is in HOURS.
The time going from B to C is simple to find.
The question essentially asks for solution of r. The number for speed or rate s is not even needed.