For time-speed-distance problems, you use the relationship .. speed = distance/time in any of its various forms.
The distance traveled at A mph is .. distance = speed * time .. distance = A*3
The time required for the rest of the journey is .. time = distance / speed .. time = (C -3A)/B
The the total time required to travel C miles is the 3 hours for the first part plus the time for the rest of the journey. .. total journey time = 3 + (C -3A)B . . . . . hours