apple pie's submission of Sad Splits | CodeChef