After reaching the point at 25 m height the ball travelled 4 second to reach the maximum height and come back to same point. So the to come back to the same point from maximum height it took 2 second. So the distance covered in the time is
So the total height is
Now if u was the initial velocity then maximum height is given by
So the initial velocity was 29.56.