Getting TLE

Getting TLE :

Solution Link : Solution: 54267242 | CodeChef

Your code times out for the following test case

Input

1
4
1 Like