my two test cases are passing but third ne is showing TLE
PMO gives two random numbers a & b to the Prime Minister. PM Modi wants to visit all countries between a and b (inclusive) , However due to shortage of time he can’t visit each and every country , So PM Modi decides to visit only those countries,for which country number has two divisors. So your task is to find number of countries Mr.Modi will visit.
#include
using namespace std;
define long long int;
int32_t main() {
int t;
cin>>t;
while(t–){
int s,e;
cin>>s>>e;
int no,i, count =0;
for( no=s;no<=e;no++){
for( i=2;i<no;i++){
if(no%i==0){
break;
}
}
if(i == no){
count++;
}
}
cout<<count<<endl;
}
return 0;
}