1. Two railway stations are 2km apart. A train starts from station with an acceleration of x m/s^2 for a certain time and then retards at 2x m/s^2 until it reaches the next station. It travels for a total time of 2 minutes. Find the value of x and the greatest speed attained.

2. A train passes a station A at 30 km/h, maintains this speed for 7km and is then uniformly retarded to stop at B, 8km from A. A second train starts from A at the instant the first train passes it. It is uniformly accelerated for part of the way and uniformly retarded at the same rate for the rest of the way to stop at B at the same time that the first train stops. Find the greatest speed of the second train.

Thanks.