What's wrong with my code?

Problem: https://hack.codingblocks.com/app/practice/3/715/problem
Solution: https://ide.codingblocks.com/s/427664
Error: TLE