y = y0 + (vθ0sinθ0)t - 1/2 gt2 x = x0 + (v0cosθ0)t x0 and y0 = 0
You want to solve for θ0 , so you you want to do is eliminate t t = x/ (v0cosθ0)
y = xtanθ0 - gx2/(2v02cos2θ0)
Now, it gets a little crazy. 1/cos2 = sec2 = 1+tan2
y = -gx2/(2v02) + x tanθ0 - gx2/(2v02) tan2θ0
which is a quadratic for tanθ0 for which you can use the quadratic formula. The tangent solution will give two possible angles if there is a solution. (Any angle between the two angles will work.
This problem is pretty advanced.