Getting WA for last year kharagpur regional practise problem.

Problem Link : Problem

Solution Link : Solution