Karthik's submission of Endgame | CodeChef