Ritesh's submission of Mahasena | CodeChef