TLE error in my code!

my one test case is not passing and showing TLE error ,please help me to optimize my code .I have seen editorial but did not get it.

please share your code through ide.codingblocks.com

it is in collaboration mode ,you can have a look.

@varu It is not showing any code in collaboration mode.