Shivam's submission of Mahasena | CodeChef