Got TLE for a question

I’ve passed 134/138 test cases for this problem, on the 135th test case got a TLE. Pls suggest what changes can I make within my code to avoid the TLE.
https://ide.codingblocks.com/s/377312 - my code

question-

hey @nidhigupta847 you are doing your course in java ?

No, its c++…

@nidhigupta847 okay wait then .

hey @nidhigupta847 please share your code as well .
if your code is able this much number of test cases then there must be some edge test cases you are not handling .

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.