Sergey's submission of Distribute Apples | CodeChef