#include

#include<math.h>

using namespace std;

int main()

{

int t,i,m,n;

long long a,b,c,j,k,h[100];

cin>>t;

for(i=0;i<t;i++)

{

cin>>a>>b;

for(j=b;j>=a;j–)

{

m=0;

n=0;

for(k=2;k<sqrt(j);k++)

if(j%k==0)

{

m=1;

break;

}

if(m==1)

{

n=1;

h[i]=j;

break;

}

```
}
if(n==0)
h[i]=-1;
}
for(i=0;i<t;i++)
cout<<h[i]<<endl;
}
```

this code gives wrong ans. can you please find the error