Average speed is defined as the ratio of total distance covered in total given time

here we know that total distance that man moved is


so total distance is



now here total time of the motion is


total time will be given as


now by above formula


so his average speed is 30 km/h