Time limit Exceeded in Discrepancies in the voters list

https://www.codechef.com/viewsolution/18888688