Time Limit exceeded

I tried every possible way still its showing tle…please have a look at my code and help me to resolve it