Where is tle in one test case?

@kailash_01
hello kailash,
u are getting tle because maximum value of t can be 10000
image

and for each test case u r running loop for 1000000 times due to which overall number of operations are 10000 X 1000000 which is greater than 10^8 .

to remove tle just store each prime numbers in an array or vector (say pr) and print pr[n-1] when u r asked to print nth prime

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.