Let the boxes be marked as A, B, C. We have to ensure that no box remains empty and all five balls have to put
in. There will be two possibilities.
(i) Any two two containing one ball each and 3rd box containing 3 balls. Number of ways
Since, the box containing 3 balls could be any of the three boxes A, B, C.
Hence, the required number of ways 20 x 3=60.
(ii) Any two box containing 2 balls each and 3rd containing 1 ball, the number of ways
Since, the box containing 1 ball could be any of the three boxes .A, B, C.
Hence, the required number of ways = 30 x 3 = 90.
Hence, total number of ways =60 + 90 = 150