#include<bits/stdc++.h>
using namespace std;
bool isPrime(int n)
{
// Corner cases
if (n <= 1)
return false;
if (n <= 3)
return true;
// This is checked so that we can skip
// middle five numbers in below loop
if (n % 2 == 0 || n % 3 == 0)
return false;
for (int i = 5; i * i <= n; i = i + 6)
if (n % i == 0 || n % (i + 2) == 0)
return false;
return true;
}
int main()
{
int t;
cin >> t;
while (t–)
{
int count;
cin>>count;
for (int i = 2; i <= INT_MAX;i++){
if(isPrime(i))
count–;
if(count==0)
{
cout << i << “\n”;
break;
}
}
}
return 0;
}
this is my code its not working for a single test case showing time limit error is there any other efficient way