Feedback for SMOL problem

Learning course: Level up from 1* to 2*
Problem Link: CodeChef: Practical coding for everyone


my code is correct ang giving perfect outputs nut the compiler is always giving TLE error

Your code is failing for the hidden test cases that have higher values.
So u need to optimize your code.