amarmalik's submission of Magic Prime | CodeChef