//Can anyone please tell me whats wrong in this, Iam getting TLE, even though I have used seive of //erathothenes
//Below is the code i have written-
#include <bits/stdc++.h>
using namespace std;
void SieveOfEratosthenes(int n)
{
bool prime[n+1];
memset(prime, true, sizeof(prime));
for (int p=2; p*p<=n; p++)
{
if (prime[p] == true)
{
for (int i=p*p; i<=n; i += p)
prime[i] = false;
}
}
int p,c = 0;
for (p=2; p<=n; p++)
{
if (prime[p])
//cout << p << " ";
{
c++;
if(c == (n/3))
{
cout<<p<<endl;
break;
}
}
}
}
int main(){
int tt;
cin>>tt;
for(int m=0;m<tt;m++)
{
int n;
cin>>n;
SieveOfEratosthenes(n*3);
}
return 0;
}