The answer is actually 5 hours.
The trick is to keep in mind that the question asks for the time required for car B to overtake car A.
The fact that car B starts 1 hour later than car A implies that car B must travel the same distance car A travelled, but it must do so one hour faster.
Let's say that car A travels a distance equal to
Car B, on the other hand, must travel the same distance in
This will get you
However, this is the time needed for car A to reach distance d, which means that car B will need
to catch car A.
In this type of problem it is enjoying to use a trick.
In the instant in which the car B starts its motion, the car A is:
The trick consists in virtually stopping A, and giving to B the velocity:
Now the question is different: we have to know in how many hours B can run
The answer is easy: