A train, initially at rest at a station, has a uniform acceleration of until it reaches a speed of . It travels for a time at this constant speed and then has a uniform deceleration of until it comes to rest at the next station. The distance between the two stations is . What is the time taken by the train to travel between the two stations?