apple pie's submission of Magical Doors | CodeChef