Mayank Jain's submission of Mahasena | CodeChef