A few guidelines first:

Coming to your problem, (I am assuming you know how to calculate time complexity of your code, if not, learn it first).

The two nested `for`

-loops make your solution O(t * maxX * n). as maxX can be upto 10^{9}, n upto 10^{5} and t upto 10, your solution can take upto 10^{15} calculations. Given that codechef allows roughly 10^{8} calcluations per second, calculate how much time your solution will take to finish.

P.S. Allowed time limit for each problem is mentioned in the bottom (along with tags, author details and other meta data).

You may try to optimize your solution, or look at the editorial provided at the end of problem page.

2 Likes