Assume Total Distance = $L$ and Initial Speed = $x$
$\begin{align*} & \frac{L}{x} = T ------(1)\\ & \frac{150}{x} + \frac{L-150}{\frac{3}{5}x} = T + 8 ------(2) \\ & \frac{510}{x} + \frac{L-510}{\frac{3}{5}x} = T + 4 ----(3)\\ &\text{substituting } T = \frac{L}{x} \text{ in } (2) \text{ and } (3) \\ & \frac{150}{x} + \frac{L-150}{\frac{3}{5}x} = \frac{L}{x} + 8 ------(4) \\ & \frac{510}{x} + \frac{L-510}{\frac{3}{5}x} = \frac{L}{x} + 4 ----(5)\\ \\ \end{align*}$
because we have options available, we just need to check the value of L, and it is found to be $870 \text{km}$