chandan's submission of Mahasena | CodeChef