Take 2 balls first and let their center be A and B. Distance between A and the wall of the cylindrical container = radius of the ball = 5cm. Similarly, distance between B and the wall = 5cm. So horizontal distance between A and B = 16 - 5 - 5 = 6cm.... (1) Distance between the 2 centers A and B = 5 + 5 = 10cm....(2) Applying Pythagoras thm. to (1) and (2), the vertical distance between A and B = sqrt(10^2 - 6^2) = 8cm. For 5 balls, distance between center of lowest ball and the top ball = 8 + 8 + 8 + 8 = 32cm. So min. height of cylindrical container = 5 + 32 + 5 = 42cm. Note : 32cm is the vertical distance between center of top ball and lowest ball, not center to center.