Let the speed of the train be x km/hr.
Time taken to cover 360 km = 360/x hr.
According to the question,
⇒(x+5)(360x−1)=360
⇒360−x+1800x−5=360
⇒x2+5x−1800=0
⇒x2+45x−40x−1800=0
⇒x(x+45)−40(x+45)=0
⇒(x+45)(x−40)=0
⇒x=40,−45
However, speed cannot be negative.
Therefore, the speed of train is 40 km/h.