Let the total time he travelled with a speed of 20kmh−1 is x hr.
So time taken to cover a distance with 70kmh−1 = 8-x
Total distance covered, =400km
So, from, distance=speed×time
The total distance traveled, 20x + 70(8-x) =400
20x+560−70x=400⟹50x=160
x=16050=3.2hr