A train travelled from Hong Kong to Beijing. It travelled at an average speed of 160 km/h in the first 4 hours. After that, it travelled at another average speed of 180 km/h. If the distance between Hong Kong to Beijing is 1180 km, what was the total time for the whole journey?