A train starts from rest and covers the first 200m with constant acceleration to reach a speed of 20ms−1. It then travels the next 300m at this constant speed and finally comes to rest in 10s with uniform deceleration. Calculate the total time taken for the entire journey.