Kushal Seth's submission of Mahasena | CodeChef