King and Magician | CodeChef