Code is running but it is not submitting because it is giving an Time limit exceed error. Is their any other solution without writing other code??. Please correct this code.
Giving error Time Limit Exceed at the time of Submit code
@Laxminarayan
u are getting tle because maximum value of t can be 10000
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