后面3个点全TLE了
#include <bits/stdc++.h>
using namespace std;
bool f(int n){
if(n<2) return 0;
for(int i=2;i*i<=n;i++)
if(n%i==0) return 0;
return 1;
}
bool nxd(int n){
int t=0,n1=n;
while(n1){
t=t*10+n1%10;
n1/=10;
}
return t==n;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n,m;
cin>>n>>m;
for(int i=n;i<=m;i++){
if(f(i)&&nxd(i)){
cout<<i<<"\n";
}
}
return 0;
}