public class Main {
public static void main(String args[]) {
Scanner sc= new Scanner(System.in);
int n= sc.nextInt();
int a[]= new int[n];
for(int i=0;i<n;i++){
a[i]= sc.nextInt();
}
for(int i=0;i<n;i++){
int np=1;
int k=2;
while(np<=a[i]){
boolean isPrime=true;
for(int j=2;(j*j)<=k;j++){
if(k%j==0) {
isPrime=false;
break;
}
}
if(isPrime)
np++;
k++;
}
System.out.println(k-1);
}
}
}
plz suggest me how can I optimize my code for all the test cases