It accelerates for 8 seconds with uniform acceleration 2 m/s^2. Hence the uniform speed acquires after 8 second is
v=u+at
v=0+ 2 *8=16 m/s
And the distance travelled in 8s can be calculated by s = ut + ½at2
S1 = 0+ 0.5*2*8*8= 64m
After 8s it travel 12 second with constant speed of 16 m/s, distance travelled in these 12s is S=vt
here v=16 m/s and t= 12s
therefore, S2= 16*12=192m
After these 12s ,it retards to rest with a retardation 4m/s^2. Using the formula v2 = u2 + 2as
Here u=12 m/s, v=0, a= -4m/s^2
Therefore 0=144- 2*4*S
S=144/8= 18m
Therefore total distance travelled is 64+192+18=274m