#include using namespace std; #include #include #include #include #include template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } #define rep(i,n) for (int i = 0; i < (n); ++i) typedef long long ll; using P=pair; const int INF=1001001001; const int mod=998244353; void solve(){ int l,r; cin>>l>>r; vectorseen(2*r+5); seen[1]=1; for(int i=2;i<=2*r+1;i++){ if(seen[i]){continue;} for(int j=i*2;j<=2*r+1;j+=i){ seen[j]=1; } } int cnt=0; for(int i=l;i<=r;i++){ if(!seen[i]){cnt++;} if(i