A man "A" sets out from a certain point and traveled at the rate of 6 kph. After "A" had gone two hours , another man "B" set out to overtake "A" and went 4 km the first hour, 5 km the second hour, 6 km the third hour and so gaining 1 km every hour. How many hours after "B" left were they together?

I know the formula D = rt is needed.

Man A:

rate = 6 kmh

time = x + 2

Distance:

6(x + 2)

I am having trouble setting up Man B.