candy distribution problem