Help in PERCAPTA

Here is my solution
Local Test cases are running fine. Please point out where my program is exceeding the Time limit

Many (including me) got TLE due to cin , cout. Just Replace cin,cout with scanf printf.