A train starts from rest from a station with acceleration 0.2$m$/$s^2$ on a straight track and then comes to rest after attaining maximum speed on another station due to retardation 0.4$m$/$s^2$.If total time spent is half an hour , then distance between two stations is (neglect the lenght of the train)
(a) 216$km$
(b) 512$km$
(c) 728$km$
(d) 1296$km$