Balls and Boxes Codechef Solution