Tej's submission of Mahasena | CodeChef