hi im really frustated about my code since i already optimize my code and still got tle (T^T)

here my code

or

```
#include<iostream>
#include<stdio.h>
#include<set>
#include<math.h>
using namespace std;
bool isprime(int n)
{
for(int x=3;x<=int(sqrt(n));x+=2)if(n%x==0)return 0;
return 1;
}
int main()
{
set<int> prime;
prime.insert(2);prime.insert(3);prime.insert(5);
prime.insert(7);
for(int x=9;x<=32000;x+=2)
{
if(isprime(x))prime.insert(x);
}
set<int>::iterator it;
int t;
scanf("%d",&t);
while(t--)
{
int a,b;
scanf("%d %d",&a,&b);
if(b>32000){
if(!(a&1))a++;
for(int x=a;x<=b;x+=2)
{
bool cek=1;
for(it=prime.begin();it!=prime.end();it++)
{
if(*it>int(sqrt(x)))break;
if(x%*it==0){cek=0;break;}
}
if(cek)printf("%d\n",x);
}
}
else
{
for(it=prime.begin();*it<=b && it!=prime.end();it++)
{
if(*it>=a && *it<=b ) printf("%d\n",*it);
}
}
}
}
```