Let the maximum height traveled by the ball be H and the velocity at which it is thrown up be V. At the highest point, the velocity of the ball is 0. The time taken by the ball to reach the highest point is V/9.8
The time taken by the ball to come back to the level of the balcony is also V/9.8. If the time taken by the ball to fall the last 10 m is t, 10 = V*t + (1/2)*9.8*t^2
The total time for which the ball travels is 4 s.
The time taken by it to fall the last 10 m is 4 - 2*(V/9.8)
Substituting this in the expression for the time taken by the ball to travel the last 10 m,
10 = V*(4 - 2*V/9.8) + 4.9*(4 - 2*V/9.8)^2
The solution for this equation is V = 171/10
The maximum height of the ball can be derived from 0^2 - V^2 = 2*9.8*h
h = 17.1^2/19.6 = 14.91 m
The maximum height of the ball is 14.91 m.