TopCoder SRM 595 Div2 250 LittleElephantAndBallsAgain