Akshay Gaddam's submission of Mahasena | CodeChef