Please tell me where the error is

Hey @Ferogle
1<=m<=n<=1000000000, n-m<=100000
And u are applying sieve to find prime nos upto 10^5

Also you cannot create array of size 10^9. You have to use segmented seive here

just see my code man

i used sieve for primes till 10^5 and used segmented sieve

Hey @Ferogle

        for(ll i=0;i<=m-n;i++){
            if(!rng[i]&&(i+n)!=1)cout<<i+n<<endl; //updated
        } 

otherwsie failing for testcases like this 1 10

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.