The path traced by a bullet travelling under the influence of the force of gravity is called a parabola. This force acting on a projectile (or bullet) confine its trajectory to a 2D vertical plane, which is shown in the diagram. In general, a bullet fired with a given velocity can hit a given target while either rising (green trajectory) or plummeting (red trajectory). The travel times of the two instances to reach the same target are not equal. Besides, their launch angles are different too.
We denote the speed of the bullet, the angle of its projection, its travel time, and the force of gravity by $v$, $\theta$, $t$, and $g$ respectively. furthermore, the coordinates of the bullet's firing point $B$ and the target $T$ are taken as $\left(x_0, y_0, z_0\right)$ and $\left(x_1, y_1, z_1\right)$ respectively. With that, we can state,
$$d=\sqrt{\left(x_1 - x_0\right)^2+\left(y_1 - y_0\right)^2}\quad\text{and}\quad h = z_1-z_0.\tag{1}$$
Using laws of motion under the influence of gravity, we can express $t$ and $h$ in terms of the unknown $\theta$ as shown below.
$$t=\dfrac{d}{v\cos\left(\theta\right)}\tag{2}$$
$$h = v\sin\left(\theta\right)t - \dfrac{1}{2}gt^2\tag{3}$$
Equation (2) shows that the bullet launched with the smaller angle needs shorter travel time to reach the target.
When we eliminate $\theta$ from (3) using (2), we get the following expression for $h$ in terms of $t$.
$$h = vt\sqrt{1-\dfrac{d^2}{v^2t^2}} - \dfrac{1}{2}gt^2$$
This can be simplified and rearranged to obtain the following quartic equation in $t$.
$$g^2t^4-4\left(v^2-hg\right)t^2+4\left(h^2+d^2\right)=0\tag{4}$$
The travel times $t_1$ and $t_2$ are the two positive real roots of (4). They can be written as,
$$t_1=\sqrt{2}\sqrt{a+\sqrt{b}}\quad\text{and}\quad t_2=\sqrt{2}\sqrt{a-\sqrt{b}},$$
$$\text{where}\quad a=\dfrac{v^2}{g^2}-\dfrac{h}{g},\quad\text{and}\quad b=a^2-\dfrac{h^2+d^2}{g^2}.$$
The corresponding angles of firing are given by,
$$\theta_1 =\cos^{-1}\left(\dfrac{d}{vt_1}\right)\quad\text{and}\quad \theta_2 =\cos^{-1}\left(\dfrac{d}{vt_2}\right).$$
Before attempting to determine the travel time, we need to make sure whether the bullet can reach its target. It reaches the target if and only if,
$$h\le \dfrac{1}{2}\left(\dfrac{v^2}{g}-\dfrac{d^2g}{v^2}\right).$$
If both the firing point and the target are located on the same lavel, i.e. $h=0$, travelling time can be calculated using the following set of equations.
$$t_1=\sqrt{2}\sqrt{a+\sqrt{b}}\quad\text{and}\quad t_2=\sqrt{2}\sqrt{a-\sqrt{b}},\quad\text{where}\quad a=\dfrac{v^2}{g^2},\quad\text{and}\quad b=a^2-\dfrac{d^2}{g^2}$$
For this special case, the following relationship between $\theta_1$ and $\theta_2$ holds.
$$\theta_1+\theta_2 = 90^{o}$$
When the given values $d=200m$, $h=0m$, $v=150\dfrac{m}{s}$, and $g=10\dfrac{m}{s^2}$ are substituted in the above equations, we get,
$$t_1 = 1.334654779\qquad\text{and}\qquad\theta_1 = 2.549844457^{o}\quad\text{and}$$
$$t_2 = 29.9702969\qquad\enspace\text{and}\qquad\theta_2 = 87.4501555^{o}.\quad\qquad$$
Best Answer
A hint:
You want that ${\bf r}(t)\times \dot {\bf r}(t)={\bf 0}$ and that ${\bf r}(t)\cdot \dot {\bf r}(t)<0$. The first equation says that $\dot{\bf r}(t)$ is in line with the vector ${\bf r}(t)$ pointing from ${\bf 0}$ to ${\bf r}(t)$, or vice versa, and the second equation says that the shooting direction should point towards the origin and not away from it.
Note that for an "arbitrary" flight travel you cannot expect such a happy moment.