|  | 
|  | 
| back to board | TLE #include<iostream>
 using namespace std;
 
 bool isPrime(int a)
 {
 int i;
 if(a==1) return 0;
 for(i=2; i<a; i++){
 if(a==2) return 1;
 else{
 if(a%i==0) return 0;
 }
 }
 return 1;
 }
 
 int main()
 {
 int t,j,b,count=0;
 cin>>t;
 while(t--){
 int k=1;
 cin>>j;
 while(count!=j){
 b= isPrime(k);
 if(b==1) count++;
 k++;
 }
 
 cout<<--k<<endl;
 count=0;
 }
 
 return 0;
 }
 | 
 | 
|