kapil garg's submission of Mahasena | CodeChef