Krish Iyer's submission of Mahasena | CodeChef