Ankit Wadhwa's submission of Mahasena | CodeChef