Tanmay Bansal's submission of Mahasena | CodeChef