_
How to Optimize?
_
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main
{
public static void main(String args[]) throws NumberFormatException, IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
while(t-- >0){
String m[] = br.readLine().split(" ");
//System.out.println(num[0]+ num[1]);
for (int i = Integer.parseInt(m[0]); i <= Integer.parseInt(m[1]); i++) {
if (isPrime(i) == true)
System.out.println(i);
}
}
}
public static boolean isPrime(int num) {
if (num == 1)
return false;
if (num == 2)
return true;
for (int j = 2; j <= num / 2; j++) {
if (num % j == 0)
return false;
}
return true;
}
}