TLE in PRIME VISITS of "Array challenge"

in 3rd test case, its showing TLE. First 2 test cases passed.
plz help!!! : )
CODE :

import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
int count;
int result =0;
while(t>=1){
int a = scan.nextInt();
int b = scan.nextInt();
for(int i=a; i<=b; i++){
count =0;
for(int j=1; j<=i; j++){
if(i%j==0){
count++;
}
}
if(count == 2){
result++;
}
}
System.out.println(result);
result =0;
t–;
}
}
}

Hey @amigarg2001_4d6124603ec7a2bd You need to use SOE approach for this question.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.