A projectile is ejected with vertical speed $v$ from the surface of a planet of mass $M$ and radius $R$. Show that it comes to rest at a distance r from the centre of the planet where $$r=R/(1-Rv^2/2GM)$$ If $ v = c$ in the above example what will be the condition between M and R such that the planet acts like a Newtonian black hole.

I have tried to solve it in the following way-

The height from the surface of the planet will be given by-

$$y=vt-(1/2)gt^2$$

when it comes to rest $v=0$ hence from the above equation we get

$$r-R=(1/2)gt^2$$

From relation between g and G,

$$g=Gm/r^2$$

I have put all this values in $$y=vt-(1/2)gt^2$$

but I am not getting the required answer.

Please tell me where did I made the mistake and correct me if going in the wrong direction. Thanking you.