9.1 meters
First, determine the vertical and horizontal components of the ball's velocity. So
Vhorz = cos(50)*20 m/s = 0.64278761 * 20 m/s = 12.85575219 m/s
Vvert = sin(50)*20 m/s = 0.766044443 * 20 m/s = 15.32088886 m/s
Now determine how long until the ball hits the building. Do this by dividing the horizontal distance by the horizontal velocity.
T = 30 m / 12.85575219 m/s = 2.33358574 s
Now the expression for the height of the ball is given by
h = VT - 0.5 AT^2
where
h = height
V = initial vertical velocity
T = Time
A = acceleration due to gravity.
Substituting known values.
h = (15.32088886 m/s)(2.33358574 s) - 0.5 * 9.8 m/s^2(2.33358574 s)^2
h = 35.75260778 m - 4.9 m/s^2 * 5.445622407 s^2
h = 35.75260778 m - 26.6835498 m
h = 9.069057982 m
Rounding to 2 significant figures gives 9.1 meters.
So the ball will impact the building 9.1 meters above the height at which the ball was thrown.