Answer:
The rocket hit the top half of the building.
Step-by-step explanation:
Here is the formula for displacement

Because the projectile is being launched at zero degrees, all of its velocity is in the horizontal direction and so there is no initial velocity for the fall, therefore




Now that we have the time taken for the object to fall, we can use it to find d by applying the displacement formula again. In this case we will remove the initial term because the acceleration is zero in the horizontal direction. Therefore




If there wasn't a building in the way the displacement in the x direction is 54.41.
![y=(tan0*40)-[(-9.81)/(2(22*cos0)^(2))]40^(2)](https://img.qammunity.org/2023/formulas/physics/high-school/do8lcbk1xzt7tkm78vagsozqlzkuyxm1ck.png)

Like you said the building is 30 meters tall. You were looking to find out is it was going to hit the top or bottom half.

So it hit the top half of the other building.